Menu

#1121 Phosphor not recognized by atomtype

cdk-1.2.x
closed
nobody
5
2012-11-03
2011-02-23
No

I have an AtomContainer which contains a phosphor atom without bonds. CDK cannot recognize this atomtype. I built a test to show how this occurs.

public class AtomsPNTest extends TestCase {

public void testP() throws FileNotFoundException, CDKException {
    IAtom atomP = new NNAtom(Elements.PHOSPHORUS);
    IAtomType atomTypeP = new NNAtomType(Elements.PHOSPHORUS);
    AtomTypeManipulator.configure(atomP, atomTypeP);

    IAtomContainer ac = atomP.getBuilder().newAtomContainer();
    ac.addAtom(atomP);
    IAtomType type = null;
    for (IAtom atom : ac.atoms()) {
        type = CDKAtomTypeMatcher.getInstance(ac.getBuilder()).findMatchingAtomType(ac, atom);
        Assert.assertNotNull(type);
    }
}

}

Discussion

  • Egon Willighagen

    Hi Julio, I tried your unit test, but I get no problem with either 1.2.x or 1.4.x, and the phosphor is correctly recognized. I created two patches:

    https://sourceforge.net/tracker/?func=detail&aid=3201296&group_id=20024&atid=320024#

    Please reopen this report, if you have further detail on how to reproduce your problem.

     
  • Egon Willighagen

    Aargh, I'm a stupid idiot... Julio, the test was not failing because the bloody thing didn't have the @Test annotation...

    Sorry!