User 870ab5b546
28-07-2009 18:14:28
Hi,
I appear to be getting different pKa values from the command line versus the API. I have dynamicPka() defined thusly:
<Plugin ID="dynamicpKa" Class="chemaxon.marvin.calculations.pKaPlugin" JAR="pKaPlugin.jar">
<Param Name="prefix" Value="dynamic"/>
<Param Name="type" Value="acidic"/>
<Param Name="min" Value="-1000"/>
<Param Name="max" Value="1000"/>
</Plugin>
The command line gives me,
[bob@epoch public]$ evaluate -e "dynamicpKa()" "CCC=O"
59.92;15.09;39.98;
Good enough; but with the code below running on the same molecule, I get this result:
2009-07-28 14:04:22 acidic pKa for atom C1: 51.53327188386362
no basic pKa for atom C1
acidic pKa for atom C2: 15.092359249671512
no basic pKa for atom C2
acidic pKa for atom C3: 28.65088850980738
no basic pKa for atom C3
no acidic pKa for atom O4
basic pKa for atom O4: -6.938105699195358
I don't understand why the values are different. Both the evaluate function and the Java compiler are pointing to the same pointer to JChem 5.2.3. Can you help?
-- Bob
molecule = MolImporter.importMol(substrate);
molecule.aromatize(MoleculeGraph.AROM_BASIC);
ChemUtils.stripMetalsNoClone(molecule);
numAtoms = molecule.getAtomCount();
pKaPlugin plugin = new pKaPlugin();
plugin.setMaxIons(8); // default 8
plugin.setBasicpKaLowerLimit(pKaFunctions.SMALLEST_PKA);
plugin.setAcidicpKaUpperLimit(pKaFunctions.LARGEST_PKA);
plugin.setMicropKaCalc(true);
plugin.setpKaPrefixType(pKaPlugin.DYNAMICpKaPREFIX);
plugin.setMolecule(molecule);
boolean runOK = plugin.run();
for (int atmIdx = 0; atmIdx < numAtoms; atmIdx++) {
MolAtom atm = molecule.getAtom(atmIdx);
String atmSymbol = atm.getSymbol();
if (atm.getSymbol().equals("H") && atm.getCharge() == 0)
continue;
boolean bears_H =
(atm.getImplicitHcount() + atm.getExplicitHcount() > 0);
double[] pKaAcidic = (bears_H ?
plugin.getpKaValues(atmIdx, pKaPlugin.ACIDIC)
: null);
double[] pKaBasic =
plugin.getpKaValues(atmIdx, pKaPlugin.BASIC);
double[] bothpKas = new double[] {
(pKaAcidic != null ? pKaAcidic[0] : Double.NaN),
(pKaBasic != null ? pKaBasic[0] : Double.NaN)
};
if (!Double.isNaN(bothpKas[0])) {
System.out.println("acidic pKa for atom " + atmSymbol + (atmIdx + 1)
+ ": " + bothpKas[0]);
} else System.out.println("no acidic pKa for atom " + atmSymbol + (atmIdx + 1));
if (!Double.isNaN(bothpKas[1])) {
System.out.println("basic pKa for atom " + atmSymbol + (atmIdx + 1)
+ ": " + bothpKas[1]);
} else System.out.println("no basic pKa for atom " + atmSymbol + (atmIdx + 1));
} // for each atom in the molecule