#577 RXN to FingerPrint bug

master
closed
5
2012-10-08
2007-12-15
Asad
No

As far as I have analyzed the bug, it seems to me that the BondOrder is an Enum type which has not been synchronized as "ordinal" in CDKAtomTypeMatcher.java

But I might be totally wrong too!

Please find attached the example files.

Part of the code

RXNReader(){

               rxn = new RXNContainer();
               rxn.setRXNFile(RXNFileName);

              IMoleculeSet _imoledu = rxn.getreactants();
               IMoleculeSet _imolpro = rxn.getproducts();

             for (int i = 0; i < _imoledu.getMoleculeCount(); i++) {

                   IMolecule mol = _imoledu.getMolecule(i);

                   GenerateFP(mol);
              }

}

private void GenerateFP (IMolecule molecule){

     molecule=(IMolecule)

AtomContainerManipulator.removeHydrogens(molecule);

       long RING_TIMEOUT = 900000000;

       int FINGER_SIZE=64*26;
       int DEPTH_SEARCH=8;

       AllRingsFinder ringFinder = new AllRingsFinder();
       ringFinder.setTimeout(RING_TIMEOUT);

       Fingerprinter fpr = new Fingerprinter(FINGER_SIZE, DEPTH_SEARCH);
       //BitSet FP = new BitSet();
        BitSet  FP=fpr.getFingerprint(molecule);

}

error Message

java.lang.NullPointerException
at
org.openscience.cdk.graph.SpanningTree.buildSpanningTree(SpanningTree.java:140)
at
org.openscience.cdk.graph.SpanningTree.<init>(SpanningTree.java:70)
at
org.openscience.cdk.atomtype.CDKAtomTypeMatcher.isRingAtom(CDKAtomTypeMatcher.java:368)
at
org.openscience.cdk.atomtype.CDKAtomTypeMatcher.perceiveSulphurs(CDKAtomTypeMatcher.java:415)
at
org.openscience.cdk.atomtype.CDKAtomTypeMatcher.findMatchingAtomType(CDKAtomTypeMatcher.java:77)
at
org.openscience.cdk.tools.manipulator.AtomContainerManipulator.percieveAtomTypesAndConfigerAtoms(AtomContainerManipulator.java:517)

at
org.openscience.cdk.fingerprint.Fingerprinter.getFingerprint(Fingerprinter.java:131)
at
org.openscience.cdk.fingerprint.Fingerprinter.getFingerprint(Fingerprinter.java:156)

Discussion

  • Asad

    Asad - 2007-12-15

    Example file

     
    Attachments
  • Egon Willighagen

    Logged In: YES
    user_id=25678
    Originator: NO

    Will comment after a JUnit test has been written.

     
  • Egon Willighagen

    Logged In: YES
    user_id=25678
    Originator: NO

    Added tests to MDLRXNV2000Reader (r9700) and FingerprinterTest (r9701). I cannot reproduce the stacktrace with the given test file.

     
  • Egon Willighagen

    Logged In: YES
    user_id=25678
    Originator: NO

    Dear Asad,

    can you stil reproduce this problem? If so, please send me a full code fragment that shows the stacktrace.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks