Skip to content

CDKToBeam NPE double bond stereo with labelled R-atoms #812

@dan2097

Description

@dan2097
String smiles = "N[C@H](C(N/C=C\\C[C@@H](O*)C/C=C(/*)\\C)=O)C(C)(C)C>C(=C/C(=O)O)\\C#C.CCN=C=NCCCN(C)C.Cl>N([C@H](C(N/C=C\\C[C@@H](O*)C/C=C(/*)\\C)=O)C(C)(C)C)C(=O)/C=C/C#C |$;;;;;;;;;R;;;;Y;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;R;;;;Y$,f:2.3|";
SmilesParser smilesParser = new SmilesParser(SilentChemObjectBuilder.getInstance());
smilesParser.kekulise(true);
SmilesGenerator smilesGenerator = new SmilesGenerator(SmiFlavor.Isomeric);
IReaction reaction = smilesParser.parseReactionSmiles(smiles);
for (IAtomContainer reactant : reaction.getReactants().atomContainers()) {
  System.out.println(smilesGenerator.create(reactant));
}

gives

Exception in thread "main" java.lang.NullPointerException
	at org.openscience.cdk.smiles.CDKToBeam.addGeometricConfiguration(CDKToBeam.java:320)
	at org.openscience.cdk.smiles.CDKToBeam.toBeamGraph(CDKToBeam.java:154)
	at org.openscience.cdk.smiles.SmilesGenerator.create(SmilesGenerator.java:446)
	at org.openscience.cdk.smiles.SmilesGenerator.create(SmilesGenerator.java:402)
	at org.openscience.cdk.smiles.SmilesGenerator.create(SmilesGenerator.java:363)

Note that this doesn't occur if the extended SMILES atom labels are omitted.

Tested with CDK 2.7.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions