User 870ab5b546
06-10-2011 02:48:35
Using JChem 5.6.0.0, the basic pKa of CO\C([O-])=C\C at O(4) is calculated as 10.0, and that at C(5), the enolate C, is calculated as not having one!!
If I look at its resonance structure, C[CH-]C(=O)OC, then C(2), the enolate C, now has a basic pKa of 25.5, and the enolate O has one of -3.7.
The problem is, these two drawings represent EXACTLY the same compound. Regardless of how I draw it, I should obtain the SAME basic and acidic pKa values for every atom.
I can tolerate a little bit of imprecision in the calculations, but these results are simply not acceptable. You need to redesign your algorithm to take resonance structures into account.
The code:
final String substrate = request.getParameter("substrate");
final NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(1);
numberFormat.setMinimumFractionDigits(1);
Molecule molecule = MolImporter.importMol(substrate);
molecule.aromatize(MoleculeGraph.AROM_BASIC);
int numAtoms = molecule.getAtomCount();
String[] pKas = new String[numAtoms];
String[] pKbs = new String[numAtoms];
final 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.setModel(pKaPlugin.MODEL_LARGE);
plugin.setMolecule(molecule);
plugin.run();
for (int atmIdx = 0; atmIdx < numAtoms; atmIdx++) {
pKas[atmIdx] = "";
pKbs[atmIdx] = "";
final MolAtom atm = molecule.getAtom(atmIdx);
final String atmSymbol = atm.getSymbol();
if ("H".equals(atm.getSymbol()) && atm.getCharge() == 0
&& !"[H][H]".equals(molecule.toFormat("smiles")))
continue;
final boolean bears_H =
(atm.getImplicitHcount() + atm.getExplicitHcount() > 0);
double[] atomPKs = null;
final double[] pKaAcidic = (bears_H ?
plugin.getpKaValues(atmIdx, pKaPlugin.ACIDIC) : null);
final double[] pKaBasic =
plugin.getpKaValues(atmIdx, pKaPlugin.BASIC);
atomPKs = new double[] {
(pKaAcidic != null ? pKaAcidic[0] : Double.NaN),
(pKaBasic != null ? pKaBasic[0] : Double.NaN)
};
if (!Double.isNaN(atomPKs[0])) {
pKas[atmIdx] = numberFormat.format(atomPKs[0]);
}
if (!Double.isNaN(atomPKs[1])) {
pKbs[atmIdx] = numberFormat.format(atomPKs[1]);
}
} // for each atom in the molecule
User 870ab5b546
06-10-2011 02:56:09
Here's another example. No one in their right mind would suggest that the most basic site in C=C1[CH-]C=CC=C1 is C(3), but that's exactly what your algorithm predicts. It doesn't even realize that C(1) is basic at all.
User 851ac690a0
06-10-2011 08:51:42
Hi,
The same pKa value will be calculated if the "consider tauotmerization" option is switched on. See the attached figure.
I know that this name is not right. It will be redesign.
The basic pKa for toluene is calculated if the allowed (min,max) pKa range is more broader than the default one.
This is the actual state of the pKa calculation with resonance.
I know that this answer will not satisfy you.
Jozsi
User 870ab5b546
06-10-2011 16:48:38
Setting considerTautomerization(true) certainly helps A LOT in both cases.
Not only is the name wrong, as you already know, but the default value should be true. There is no reason on Earth why someone would not want to consider resonance structures when calculating pKas. Again, resonance structures do not represent different compounds, they represent the SAME compound, and regardless of how one draws it, its atoms should have the same pKa values.
Now, what about CO\C([O-])=C\C=C and CO\C([O-])=C\C1=CC=CC=C1 ? You need to be able to handle extended resonance structures. Any plans to do so?
User 25d107bd42
06-10-2011 17:22:06
Hi, may I chime in here ?
This discussion remembers me the topic I started more than two years ago, with the title: Different calc. results for resonance formulas: https://www.chemaxon.com/forum/ftopic4491.html
At the end there was a copy of the IUPAC definitions on resonance.
Marvin must be able to handle molecules or ions given with different resonance formulas as one species.
Regards, Hans-Ulrich
User 870ab5b546
10-10-2011 15:32:37
Yes, Hans is right.
To elaborate, if I calculate the pKas of the atoms of COC(=O)\C=C\[CH2-] with setConsiderTautomerization(true) and plugin.setpKaPrefixType(pKaPlugin.DYNAMICpKaPREFIX), I see,
Atom | pKa | pKb |
---|
C1 | 36.9 | |
O2 | | |
C3 | | |
O4 | | -3.8 |
C5 | | 26.7 |
C6 | 47.2 | |
C7 | 42.9 |
|
Kudos to JChem for seeing that this compound is nothing but an enolate! This is a big improvement over previous versions. But it should realize that C7 is basic also, and it does not.
User 870ab5b546
11-10-2011 18:31:21
Here's another poor result. For COC(=O)CN=[N+]=[N-], JChem calculates an acidic pKa for C5 of 16.4, which is about right. But for the conjugate base COC(=O)[CH-]N=[N+]=[N-], JChem calculates no basic pKa for C5, but it calculates a basic pKa of 22.6 for N8. Clearly the C atom is more basic than the N atom in this compound, and clearly the basic pKa of the conjugate base should be the same as the pKa of the acid.
User 851ac690a0
12-10-2011 14:54:06
Hi,
With the "setConsiderTautomerization(false)" command the pKa values of the conjugated acid-base pairs will be the same.
With the "setConsiderTautomerization(true)" command there is a bug. I am going to fix this bug asap.
Jozsi