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); } }
}
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.
Aargh, I'm a stupid idiot... Julio, the test was not failing because the bloody thing didn't have the @Test annotation...
Sorry!
Patch available at:
https://sourceforge.net/tracker/index.php?func=detail&aid=3237292&group_id=20024&atid=320024#