Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
dan2097 opened this issue Feb 2, 2022 · 1 comment · Fixed by #813
Closed

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

dan2097 opened this issue Feb 2, 2022 · 1 comment · Fixed by #813

Comments

@dan2097
Copy link

dan2097 commented Feb 2, 2022

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

@dan2097
Copy link
Author

dan2097 commented Feb 2, 2022

The exceptions occurs in CDK 2.2, but not the preceding CDK 2.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant