From 94a39b75ebd50b58e66f779ffeb8d40f90fa20c9 Mon Sep 17 00:00:00 2001 From: ssun30 Date: Tue, 6 Aug 2024 15:12:43 -0400 Subject: [PATCH] Parser uses RMG if RDKit fails to get structure --- src/Parse.jl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Parse.jl b/src/Parse.jl index 3698081f..37585171 100644 --- a/src/Parse.jl +++ b/src/Parse.jl @@ -168,7 +168,12 @@ function getatomdictsmiles(smiles) mol.assign_representative_molecule() getatomdictfromrmg(mol.mol_repr) else - getatomdictfromrdkit(Chem.AddHs(Chem.MolFromSmiles(smiles))) + try + return getatomdictfromrdkit(Chem.AddHs(Chem.MolFromSmiles(smiles))) + catch e + println("RDKit parsing failed, using RMG instead", e) + return getatomdictfromrmg(molecule.Molecule().from_smiles(smiles)) + end end end