Menu

#1113 Atom type error for phosphor

open
nobody
None
5
2012-10-08
2010-12-22
No

When running addImplicitHydrogens(iAtomContainer) on an iAtomContainer of the sdf-file attached the error is
Exception in thread "main" org.openscience.cdk.exception.CDKException: IAtom is not typed! P
So this type of phoshpor is not recognized by CDK

CDK version used 1.3.7

There are multiple occurences of this atom type in the ZINC database.

Discussion

  • Patrik Rydberg

    Patrik Rydberg - 2010-12-22

    sdf file which produces the error

     
  • Patrik Rydberg

    Patrik Rydberg - 2010-12-22

    This should be a P.ate phosphorous atom with one attached hydrogen atom.

    Suggested change to fix this:
    change lines 921-922 in CDKAtomTypeMatcher.java to

                int doubleBonds = countAttachedDoubleBonds(atomContainer, atom);
                if (doubleBonds == 1){
                    IAtomType type = getAtomType("P.ate");
                    if (isAcceptable(atom, atomContainer, type)) return type;
                }
                else {
                    IAtomType type = getAtomType("P.ine");
                    if (isAcceptable(atom, atomContainer, type)) return type;
                }
    

    This fix has not been tested on molecules with atoms matching the P.ine atom type.