Regenerate the pH 7 protonation bundles with Marvin 26.1 - #295
Open
freiburgermsu wants to merge 1 commit into
Open
freiburgermsu wants to merge 1 commit into
freiburgermsu wants to merge 1 commit into
Conversation
Closes the item Marvin_26.1_pKa_Run.md left under "Not done here": protonations/ still held only the 23.4 bundle. 53,127 compounds, 141,715 rows -- the row count 23.4 shipped, exactly, in every source. ChEBI, KEGG and Rhea cover an identical compound set; MetaCyc swaps one (loses HypC-Dimer-Fe-CO2 to a PkaPlugin crash, gains A-DNA-WITH-OPPOSING-AP-SITE). Zero unparseable, zero non-standard InChI, zero InChIKeys disagreeing with the InChI beside them. Two things a reviewer should weigh before merging. THE TAUTOMER STEP IS MISSING. ChargeMol.java took the dominant tautomer at pH 7 before the major microspecies. That needs TautomerizationPlugin, which is licensed under the Isomers Plugin Group; these regenerations run on a Protonation-group licence, and cxcalc majortautomer returns a LicenseException. Net charge is unchanged for 79.7% of shared compounds and different for 20.3%, skewed toward deprotonation. That 20.3% is an upper bound on the tautomer effect, not a measurement of it -- it also contains the genuine 23.4 -> 26.1 engine change, which the pKa work already showed moves site counts on one shared set in seven. The two cannot be separated without that licence. Restoring the step is a few lines if it is obtained. MARVIN'S InChI AND SMILES IMPORTERS LOSE STEREOCHEMISTRY. Round-tripping the source InChI with no protonation at all reproduces it 61% of the time through the InChI importer and 39% through SMILES, against 99.6% through an RDKit-built molblock and 99.7% for RDKit alone. The loss is on import, not export. Every structure is therefore bridged through RDKit into a molblock before Marvin sees it -- which is what ChargeMol.java was doing when it read args[0] as a mol file rather than a string. On the compounds where protonation changes nothing, and the output should equal the input, this run scores 98.6-99.0% against 23.4's 96.0-98.5%; unbridged it scores 55-61% and every coverage count still looks perfect. Also: the InChIKey is derived from the InChI actually written, because Marvin's inchikey export ignores SAbs and disagrees with its own inchi export. Charge on wildcard-adjacent atoms is inherited from 23.4, not introduced, and is left alone as a curation question. Re-running rewrites a bundle byte for byte. Compound records are untouched; Update_Compound_Structures_Formulas_Charge.py is the step that rewrites them, and Print_Structure_Formula_Charge.py has not been re-run over these files. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the item
Marvin_26.1_pKa_Run.mdleft under "Not done here":protonations/still held only the 23.4 bundle. Companion to #289 / #292.53,127 compounds, 141,715 rows — the row count 23.4 shipped, exactly, in every source. ChEBI, KEGG and Rhea cover an identical compound set. MetaCyc swaps one in each direction. Zero unparseable, zero non-standard InChI, zero InChIKeys disagreeing with the InChI beside them.
Two things to weigh before merging
1. The tautomer step is missing
ChargeMol.javatook the dominant tautomer at pH 7 before the major microspecies. That needsTautomerizationPlugin, licensed under the Isomers Plugin Group; these regenerations run on a Protonation-group licence. Verified, not assumed:Net charge at pH 7 is unchanged for 79.7% of shared compounds and different for 20.3%, skewed toward deprotonation (11.8% one unit lower, 4.1% two or more; 3.6% one higher).
That 20.3% is an upper bound on the tautomer effect, not a measurement of it. It also contains the genuine 23.4 → 26.1 engine change, which the pKa work already showed moves site counts on roughly one shared set in seven — a pKa crossing 7 flips the protonation state on its own. The two cannot be separated without an Isomers licence, and the report does not pretend otherwise. Restoring the step is a few lines if that licence is obtained.
2. Marvin's InChI and SMILES importers lose stereochemistry
Likely the most reusable finding here, and not documented anywhere obvious. Round-tripping the source InChI with no protonation at all — import, export, compare:
MolImporter.importMol(<InChI>)MolImporter.importMol(<SMILES>)MolImporter.importMol(<RDKit molblock>)The loss is on import, not export — what goes is the
/tand/mparity layers. Every structure is therefore bridged through RDKit into a molblock before Marvin sees it, which is whatChargeMol.javawas doing when it readargs[0]as a mol file rather than a string.Measured on the compounds where protonation changes nothing, so output should equal input:
Unbridged this scores 55–61% — and every coverage count still looks perfect.
inchi:AuxNone,SAbson export matters just as much: withoutSAbs, 30.9%.Smaller notes
inchikeyexport ignoresSAbsand disagrees with its owninchiexport — forPOLYMER_10033it emits...-ARPYZQPTNA-Nwhere the InChI it just wrote hashes to...-VFUOTHLCSA-N, which is what 23.4 shipped. 0 disagreements across all 44,294 InChI rows.cxcalc majormsagree on 296/300 ChEBI compounds; all 4 exceptions are organometallics where cxcalc silently drops the metal fragment (C35H34MgN4O5→C35H34N4O5). Same reasonChargeMol.javafragmented and re-fused.aromatize()on query atoms leaves bonds no SMILES writer can express, and MetaCyc spells its protein-bound cofactors with~any-bonds. Without handling both, 156 MetaCyc compounds would have been lost silently.*[NH2+][C@@H](...forPOLYMER_12621; so does this. Correcting it is a curation decision about what*means, so it is recorded and left alone.InChI=1S/p+1, no heavy atom — 23.4 has no row either, so agreeing is correct). The one real failure is MetaCycHypC-Dimer-Fe-CO2, anArrayIndexOutOfBoundsExceptioninPkaPlugin.run()— one row out of 141,715.Not done here
Update_Compound_Structures_Formulas_Charge.pyis the step that rewrites them.Print_Structure_Formula_Charge.pyhas not been re-run over these files; the formula/charge columns are Marvin's own.CHEBI_). The id-format migration stays separate.Full detail in
Biochemistry/Structures/_reports/Marvin_26.1_Protonation_Run.md.Generated by Claude Code