#1121 Phosphor not recognized by atomtype

cdk-1.2.x
closed
nobody
5
2012-11-03
2011-02-23
Julio Peironcely
No
0 up votes | 0 down votes | 0%
2 comments

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

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

    Sorry!