Menu

#1371 absolute smiles generator fails again

cdk-1.6.x
closed
nobody
None
1
2015-11-28
2015-09-08
No
    String smi = "[O-][N ](c1c(N(CC)CCCC)c([N ]([O-])=O)[14cH2]c(C(F)(F)F)c1)=O";
    IAtomContainer mol = new SmilesParser(SilentChemObjectBuilder.getInstance()).parseSmiles(smi);
    mol = AtomContainerManipulator.copyAndSuppressedHydrogens(mol);
    System.out.println(SmilesGenerator.absolute().create(mol));

causes

Exception in thread "main" org.openscience.cdk.exception.CDKException: An InChI could not be generated and used to canonise SMILES: null
at org.openscience.cdk.smiles.SmilesGenerator.inchiNumbers(SmilesGenerator.java:509)
at org.openscience.cdk.smiles.SmilesGenerator.labels(SmilesGenerator.java:477)
at org.openscience.cdk.smiles.SmilesGenerator.create(SmilesGenerator.java:380)
at org.openscience.cdk.smiles.SmilesGenerator.create(SmilesGenerator.java:330)
..
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.openscience.cdk.smiles.SmilesGenerator.inchiNumbers(SmilesGenerator.java:502)
... 5 more
Caused by: org.openscience.cdk.exception.CDKException: Could not generate InChI Numbers: Unknown element(s): *
at org.openscience.cdk.graph.invariant.InChINumbersTools.auxInfo(InChINumbersTools.java:235)
at org.openscience.cdk.graph.invariant.InChINumbersTools.getUSmilesNumbers(InChINumbersTools.java:77)
... 10 more

Discussion

  • Martin Gütlein

    Martin Gütlein - 2015-09-08

    cdk version is 1.5.10 not 1.0 (cannot change ticket anymore)

     
  • Egon Willighagen

    • Group: cdk-1.0.x --> cdk-1.6.x
     
  • John May

    John May - 2015-09-08

    Actually I don't think that's a bug.. In your input you have '[N ]' which is loaded a pseudoatom '*' or 'R'. InChI does not support pseudo atoms so nothing we can do for now.

    Just to check can you print the isomeric SMILES - should have a '*' in it? Where is the input from?

    John

     
  • Martin Gütlein

    Martin Gütlein - 2015-09-08

    Sorry, you are completly right, the original input was
    [O-]N+c(N+=O)[14cH2]c(C(F)(F)F)c1)=O

    The plus-characters got lost when posting to our web-services...

     
  • John May

    John May - 2015-09-08

    Awesome - I do have prototypes for a better canonicaliser that will do stereo (we have to use InChI for now) and allow pseudo atoms. Okay to close?

     
  • John May

    John May - 2015-11-28
    • status: open --> closed