diff --git a/src/Parse.jl b/src/Parse.jl index 0c3fd4b0..b23fee1a 100644 --- a/src/Parse.jl +++ b/src/Parse.jl @@ -166,14 +166,10 @@ export getatomdictsmiles getatomdictinchi(inchi) = getatomdictfromrdkit(Chem.AddHs(Chem.MolFromInchi(inchi))) export getatomdictinchi function getatomdictadjlist(adjlist) - try - mol = species.Species().from_adjacency_list(adjlist).molecule[1] - catch - @error("Unable to parse adjlist $adjlist") - end - if isa(mol, molecule.Molecule) + mol = species.Species().from_adjacency_list(adjlist).molecule[1] + if pybuiltin(:isinstance)(mol, molecule.Molecule) getatomdictfromrmg(mol) - elseif isa(mol, fragment.Fragment) + elseif pybuiltin(:isinstance)(mol, fragment.Fragment) mol.assign_representative_molecule() getatomdictfromrmg(mol.mol_repr) else