Hi
I'm a new user of CDK. It's a great tool and I'm learning a lot. I'm currently trying to use the aromaticity detection tool, the Aromaticity. In a test I built a benzene molecule, an instance of the IAtomContainer. This was successful and I was able to create an image of it in the SVG format. Then I went on to try to detect aromaticity using the following code snippet.
Aromaticity a = new Aromaticity(ElectronDonation.cdk(), Cycles.all());
a.apply(molecule);
The aromaticity.apply call throws the following error.
java.lang.NullPointerException: atom has unset atom type
at java.util.Objects.requireNonNull(Objects.java:228)
at org.openscience.cdk.aromaticity.AtomTypeModel.contribution(AtomTypeModel.java:112)
I trace the error back to this line of code in AtomTypeModel.java
Objects.requireNonNull(atom.getAtomTypeName(), "atom has unset atom type");
Am I supposed to programmatically set the AtomTypeName? If the answer is yes, then why so? Is there a simpler way to set the atom type name?
I will greatly appreciate your help.
_______________________________________________