Hi folks,

I'm getting a NPE from AtomAtomMapping.getCommonFragmentAsSMILES() in certain cases.
An example is below - the two structures differ only for a Cl <-> Br change.

This is using the org.openscience.smsd.AtomAtomMapping, org.openscience.smsd.Isomorphism and org.openscience.smsd.tools.ExtAtomContainerManipulator classes.
Not sure if those guys are active on this list?


IAtomContainer query =smilesParser.parseSmiles('BrC1CCC(Cc2ccccc2)C1')
IAtomContainer target =smilesParser.parseSmiles('ClC1CCC(Cc2ccccc2)C1')

StructureDiagramGenerator sdg =new StructureDiagramGenerator()
sdg.generateCoordinates(query)

ExtAtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(query)
ExtAtomContainerManipulator.aromatizeMolecule(query)

ExtAtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(target)
ExtAtomContainerManipulator.aromatizeMolecule(target)

Isomorphism comparison =new Isomorphism(query, target, 
Algorithm.DEFAULT,true,false,false)
AtomAtomMapping mapping = comparison.getFirstAtomMapping()

String mcsSmiles = mapping.getCommonFragmentAsSMILES()

The error I get is:

java.lang.NullPointerException
    at org.openscience.cdk.silent.AtomContainer2.getAtomRefUnsafe(AtomContainer2.java:172)     at org.openscience.cdk.silent.AtomContainer2.getBond(AtomContainer2.java:612)     at org.openscience.smsd.AtomAtomMapping.getCommonFragment(AtomAtomMapping.java:332)     at org.openscience.smsd.AtomAtomMapping.getCommonFragmentAsSMILES(AtomAtomMapping.java:371)     at org.squonk.fragnet.depict.ChemUtilsSpec.alignMolecule2(ChemUtilsSpec.groovy:81)




_______________________________________________
Cdk-user mailing list
Cdk-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to