Technical Support Forum Index
Technical Support Forum
Access ChemAxon scientists and developers here. For registration and login issues contact website support.

Support Ticket System is replacing forum

This forum was converted into a searchable archive. You cannot add posts here any more. For support please use our new Ticket System.

Create your first ticket
NullPointerException from PFGenerator
To watch this topic for replies  Register (enables digests) or give email address:
This topic is locked: you cannot edit posts or make replies.
Display posts from previous:   
    View previous topic :: View next topic    
Author Message
Mark

Joined: 22 Sep 2006
Posts: 22

View user's profile

Back to top
Link to postPosted: Mon Sep 15, 2014 9:24 pmPost subject: NullPointerException from PFGenerator Reply with quote

Code is basically the example in the PFGenerator javadoc. Any ideas please?

Exception in thread "main" java.lang.NullPointerException
at chemaxon.descriptors.PFGenerator.generate(PFGenerator.java:153)
at util.GeneratePF.main(GeneratePF.java:20)

public class GeneratePF {

public static void main(String[] args) throws Exception {
MolImporter mi = new MolImporter("C:/Program Files/ChemAxon/JChem/examples/screen/nci1000.sdf");
PMapper m = new PMapper(new File("C:/Program Files/ChemAxon/JChem/examples/screen/pharma-frag.xml"));
PFGenerator gen = new PFGenerator(m);
gen.setUsePMAP(false);
PharmacophoreFingerprint pfp = new PharmacophoreFingerprint();
Molecule mol;
while ((mol = mi.read()) != null) {
String[] newTags = gen.generate(mol, pfp);
}
mi.close();
}
}
László
ChemAxon personnel
Joined: 14 Jan 2011
Posts: 78

View user's profile

Back to top
Link to postPosted: Mon Sep 29, 2014 1:58 pmPost subject: Reply with quote

Dear Mark,

The setParameters() function is missing from the code example. Sorry for the inconvenience, we will correct it in the next release.

Try to use this example:

Molecule testMol = MolImporter.importMol("CC(=O)OC1=CC=CC=C1C(O)=O", "smiles");
PMapper m = new PMapper(new File("pharma-frag.xml"));
PFGenerator gen = new PFGenerator(m);
gen.setUsePMAP(false);
PharmacophoreFingerprint pfp = new PharmacophoreFingerprint();
pfp.setParameters(new PFParameters());
String[] newTags = gen.generate(testMol, pfp);

Best regards,
Laszlo

This topic is locked: you cannot edit posts or make replies.
Page 1 of 1


To watch this topic for replies   Register (enables digests) or give email address  
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum