Menu

#1385 nullpointer in circular fingerprinter

master
closed
nobody
None
1
2017-01-06
2017-01-05
No

This is related to
https://sourceforge.net/p/cdk/bugs/1357/

caused by: java.lang.NullPointerException
    at org.openscience.cdk.fingerprint.CircularFingerprinter.rubricTetrahedral(CircularFingerprinter.java:859)
    at org.openscience.cdk.fingerprint.CircularFingerprinter.excavateMolecule(CircularFingerprinter.java:603)
    at org.openscience.cdk.fingerprint.CircularFingerprinter.calculate(CircularFingerprinter.java:201)

unfortunately, I cannot reproduce this bug, sometimes it occurs with this compound:
C([C@@H]1C@H/C=C\C(=O)O)/C#N)O)O)O)O

all i do with the molecule is parsing the smiles, and all 2d positions are null

maybe the fix from the bug above should be applied to line 859 as well?

Related

Bugs: #1385

Discussion

  • Martin Gütlein

    Martin Gütlein - 2017-01-05

    C([C@@H]1[C@H]([C@@H]([C@H]([C@@H](O1)O/C(=C(\CC(=O)O)/C=C\C(=O)O)/C#N)O)O)O)O

    here is the smiles again with [] brackets

     
  • Martin Gütlein

    Martin Gütlein - 2017-01-05

    ok, I can now reproduce it:

    String smiles = "CCCC([C@@H]1[C@H]([C@@H]([C@H]([C@@H](O1)O/C(=C(\\CC(=O)O)/C=C\\C(=O)O)/C#N)O)O)O)O";
    IAtomContainer mol = new SmilesParser(SilentChemObjectBuilder.getInstance())
                        .parseSmiles(smiles);
    new DepictionGenerator().depict(mol);
    new CircularFingerprinter().getBitFingerprint(mol);
    

    the code works if the depiction is disabled

    I have not investigated why, but apparently the depiction changes the molecule in a way the fp computation fails

    I dont like the fact that the fp results depend on the d2 layout. so far I did not care about that. should I perform a 2d layout before calculating the fp or not?

     
    • John May

      John May - 2017-01-05

      Odd will investigate. BTW we're wanting to move to github for issues.

       
      • John May

        John May - 2017-01-05

        Fixed - problem was more subtle though: https://github.com/cdk/cdk/pull/259

        On 5 January 2017 at 15:37, John May jwmay@users.sf.net wrote:

        Odd will investigate. BTW we're wanting to move to github for issues.

        Status: open
        Group: master
        Created: Thu Jan 05, 2017 01:55 PM UTC by Martin Gütlein
        Last Updated: Thu Jan 05, 2017 02:47 PM UTC
        Owner: nobody

        This is related to
        https://sourceforge.net/p/cdk/bugs/1357/

        caused by: java.lang.NullPointerException
        at org.openscience.cdk.fingerprint.CircularFingerprinter.rubricTetrahedral(CircularFingerprinter.java:859)
        at org.openscience.cdk.fingerprint.CircularFingerprinter.excavateMolecule(CircularFingerprinter.java:603)
        at org.openscience.cdk.fingerprint.CircularFingerprinter.calculate(CircularFingerprinter.java:201)

        unfortunately, I cannot reproduce this bug, sometimes it occurs with this
        compound:
        C([C@@H]1C@H
        https://sourceforge.net/../%5BC@@H%5D(%5BC@H%5D(%5BC@@H%5D(O1)O/C(=C(%5CCC(=O)O
        /C=C\C(=O)O)/C#N)O)O)O)O

        all i do with the molecule is parsing the smiles, and all 2d positions are
        null

        maybe the fix from the bug above should be applied to line 859 as well?

        Sent from sourceforge.net because you indicated interest in
        https://sourceforge.net/p/cdk/bugs/1385/

        To unsubscribe from further messages, please visit
        https://sourceforge.net/auth/subscriptions/

         

        Related

        Bugs: #1385

  • John May

    John May - 2017-01-05
    • status: open --> closed
     
  • John May

    John May - 2017-01-06

    BTW martin if you want to fix your example either generate the depiction using SDG first or call bond.setStereo(IBond.Stereo.None) on all bonds.

    The issue is the depiction generator needs a layout for the depiction so it automatically creates if it's not there - it also scales coordinates. Afterwards and to avoid side affects it rollsback the molecule to the state before the function was called - i.e. no coordinates. I forgot part of a layout is also wedge bonds which need to be reset as well.

    John

     
  • Martin Gütlein

    Martin Gütlein - 2017-01-06

    Thanks for the explanation. I have two more questions:

    How is the circular FP different if SDG is computed beforehand or not?

    Should SDG be applied before computing circular fingerprints?

     
    • John May

      John May - 2017-01-06

      It will be different if there's stereochemistry, it would be possible to
      make them the same but no ones done that yet. However since the
      fingerprints are used for similarity and not identity it should be v.
      similar and cluster correctly.

      I'm sure if anyone's done an activity benchmark where stereochemistry is
      important (clearly it is) but no test sets.

      John