Skip to content

Commit

Permalink
Parser uses RMG if RDKit fails to get structure
Browse files Browse the repository at this point in the history
  • Loading branch information
ssun30 committed Sep 24, 2024
1 parent 2784fc2 commit 94a39b7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Parse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 94a39b7

Please sign in to comment.