Hi,
I am working on a Pathvisio plugin that implements CDK for calculation
of metabolite properties, however I cannot get the InChIGenerator to
work.
I am using the following code which i adopted from the Groovy
Cheminformatics book by Egon Willighagen:
InChIGeneratorFactory factory = null;
InChIGenerator generator = null;
try {
generator = factory.getInChIGenerator(molecule);
System.out.println(generator.getLog());
String InChI = generator.getInchi();
String InChIKey = generator.getInchiKey();
in which the molecule is made using the SmilesParser (I also added
explicit hydrogens to the molecule).
When using this code, I'm getting the following exception:
Exception in thread "pool-2-thread-1" java.lang.NullPointerException
at metaboliteplugin.MetaboliteInfo.Inchi(MetaboliteInfo.java:311)
at metaboliteplugin.MetaboliteInfo.getContent(MetaboliteInfo.java:265)
at metaboliteplugin.MetaboliteInfo$2.run(MetaboliteInfo.java:146)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:679)
Which indicates that the problem lies at the line:
generator = factory.getInChIGenerator(molecule);
Thanks in advance for helping me out.
Best,
Rianne
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user