Skip to content

OpenBabel to molecule conversion fails with AtomTypeError #115

@rwest

Description

@rwest

Not sure if the problem is with the writing or the reading.

I had a molecule in an RMG run that was turned into the smiles c1(C=C)coo1
but when you try to turn that back into a molecule, you get:

  File "molecule.py", line 928, in rmgpy.molecule.molecule.Molecule.fromSMILES (build/pyrex/rmgpy/molecule/molecule.c:15015)
  File "molecule.py", line 940, in rmgpy.molecule.molecule.Molecule.fromSMILES (build/pyrex/rmgpy/molecule/molecule.c:14948)
  File "molecule.py", line 1006, in rmgpy.molecule.molecule.Molecule.fromOBMol (build/pyrex/rmgpy/molecule/molecule.c:15692)
  File "molecule.py", line 713, in rmgpy.molecule.molecule.Molecule.updateAtomTypes (build/pyrex/rmgpy/molecule/molecule.c:11598)
  File "atomtype.py", line 233, in rmgpy.molecule.atomtype.getAtomType (build/pyrex/rmgpy/molecule/atomtype.c:3917)
  File "atomtype.py", line 285, in rmgpy.molecule.atomtype.getAtomType (build/pyrex/rmgpy/molecule/atomtype.c:3796)
rmgpy.molecule.atomtype.AtomTypeError: Unable to determine atom type for atom O.

Same thing for the equivalent SMILES string C1(=COO1)C=C (converted via NCI/CADD resolver), which makes me think the problem is with reading, rather than writing.

I think the correct adjacency list is

1 C 0 {2,D} {4,S} {5,S}
2 C 0 {1,D} {3,S}
3 O 0 {2,S} {4,S}
4 O 0 {1,S} {3,S}
5 C 0 {1,S} {6,D}
6 C 0 {5,D}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions