??NullPointerException in pka calculation??

User 21b7e0228c

26-04-2005 13:37:29

When I plugin.setMolecule and plugin.run the pka plugin from Java I get a null pointer exception for a very simple molecule: C1Cc2ccccc2Nc3ccccc13 ... after successful processing of 713 predecessors in a sdfile (not that this would matter, it also crashes when i submit the smiles all alone). FRUSTRATION!!

ChemAxon 43e6884a7a

26-04-2005 14:11:23

Hi Dragos,


I cannot reproduce this problem. Which version are you using? Are you running cxcalc?


Ferenc

ChemAxon 43e6884a7a

26-04-2005 14:12:51

I see, your are using the API, not cxcalc. The version information would still be useful.

User 21b7e0228c

26-04-2005 14:19:05

You're right, it works without problem if I try to run the pKa property predictor in MSketch, for that matter... it's just the plugin.run() in the API that dies. I'm on jchem 3.0.8 and Java 1.5.





Cheers!

ChemAxon fb166edcbd

26-04-2005 16:28:43

I could not reproduce the crash. I tried the following with Marvin 3.5.4 which is the Marvin in JChem 3.0.8 and with JRE 1.5.0_02:





Code:



java pKaTest t.smiles








Could you test this code as well?


Or you can also attach your code and then I can try yours.


If you get any error message / exception stack trace then please include that in your response.

User 21b7e0228c

28-04-2005 09:49:10

Thank you folks, I got it - crash happened because I had set limitz in my code:





//plugin.setBasicpKaLowerLimit(1.0);


//plugin.setAcidicpKaUpperLimit(14.0);





(for if I were to swallow my pka.plugin-designed pills, I'd still use a glass of water instead of H2SO4 or NaOH ;-). Somehow the plugin did not like my oppressive denial of the existence of proteolytic equilibria outside this range. Long live PLO! (the Proton Liberation Organization). By the way, imposing the unpopular limits above also causes a krash with Oc1ccc2ccccc2c1\N=N\c3ccc(cc3)\N=N\c4ccccc4...

ChemAxon fb166edcbd

28-04-2005 10:31:39

Now I could produce this by setting the pKa limits and testing with your second test molecule (t1.smiles):





Code:



java pKaTest t1.smiles


 


pKa values:


Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1


        at chemaxon.calculations.pKa.gethBond1Inc(pKa.java:7829)


        at chemaxon.calculations.pKa.getOHAcidicpKa(pKa.java:1417)


        at chemaxon.calculations.pKa.getApKa(pKa.java:854)


        at chemaxon.calculations.pKa.getAcidicpKa(pKa.java:138)


        at chemaxon.calculations.Ionizer.getMicropKa(Ionizer.java:557)


        at chemaxon.calculations.Ionizer.calcSpeciesRatio(Ionizer.java:1500)


        at chemaxon.calculations.Ionizer.calcSpeciesOrder(Ionizer.java:1589)


        at chemaxon.calculations.Ionizer.calcMsDistribution(Ionizer.java:1719)


        at chemaxon.calculations.Ionizer.calculatepKa(Ionizer.java:1879)


        at chemaxon.calculations.Ionizer.calculatepKa(Ionizer.java:1863)


        at chemaxon.marvin.calculations.pKaPlugin.run(pKaPlugin.java:474)


        at pKaTest.testpKa(pKaTest.java:40)


        at pKaTest.main(pKaTest.java:21)








Also crahes from msketch/mview when the limits are set to 1 and 14 resp.





We will investigate this problem. However, the with the first molecule (t.smiles) it worked fine.

ChemAxon fb166edcbd

03-06-2005 00:27:42

Now this is fixed.


The correction will be available in the next major Marvin release (Marvin 4.0).