Menu

#1370 absolute smiles generator fails

master
closed
nobody
1
2015-09-06
2015-09-03
No

this code

String smi = "O=[Bi]Cl";
    IAtomContainer mol = new SmilesParser(SilentChemObjectBuilder.getInstance()).parseSmiles(smi);
    System.out.println(SmilesGenerator.absolute().create(mol));

causes this exception

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: java.lang.StringIndexOutOfBoundsException: String index out of range: -60
at java.lang.String.substring(String.java:1911)
at org.openscience.cdk.graph.invariant.InChINumbersTools.parseUSmilesNumbers(InChINumbersTools.java:113)
at org.openscience.cdk.graph.invariant.InChINumbersTools.getUSmilesNumbers(InChINumbersTools.java:78)
... 10 more

Discussion

  • Martin Gütlein

    Martin Gütlein - 2015-09-03

    cdk version is 1.5.10

     
  • Martin Gütlein

    Martin Gütlein - 2015-09-03

    also failing on: C[Hg]Cl

     
  • John May

    John May - 2015-09-03
     
  • John May

    John May - 2015-09-06
    • status: open --> closed
     
  • John May

    John May - 2015-09-06

    Closed - now resolved.