Repository navigation
Exclude carboxylates from conjugated bonds rebuilding in RDKitConverter (#3996) - #5550
Closed
RK-NerdyBirdy wants to merge 1 commit into
Closed
RK-NerdyBirdy wants to merge 1 commit into
RK-NerdyBirdy wants to merge 1 commit into
Conversation
…er (MDAnalysis#3996) - Update SMARTS patterns in `_rebuild_conjugated_bonds` to exclude carboxylate anions `[O-]-C(=O)` from being matched as unstandardized conjugated systems. This resolves infinite ping-pong double bond oscillations between carboxylate oxygens that reached `max_iter=200` with UserWarning. - Guard `reorder_atoms` in `MDAnalysisInferrer.__call__` so that it only runs when the molecule was converted from an AtomGroup with `_MDAnalysis_index`, preventing spurious warning spam when inferring generic molecules. - Add regression tests covering acetate, benzoate, aspartate, phthalate, cinnamate, and fumarate, and verify that inferring generic molecules emits no missing property warnings. Fixes MDAnalysis#3996 Signed-off-by: Maneet Gupta <131141424+RK-NerdyBirdy@users.noreply.github.com>
Documentation build overview
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #5550 +/- ##
========================================
Coverage 93.93% 93.93%
========================================
Files 184 184
Lines 22675 22676 +1
Branches 3227 3228 +1
========================================
+ Hits 21300 21301 +1
Misses 915 915
Partials 460 460 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Fixes #3996
Changes made in this Pull Request:
MDAnalysisInferrer._rebuild_conjugated_bondsto exclude carboxylate anions[O-]-C(=O)([!$([O-][#6]=O);*-{1-2}]) from being matched as unstandardized conjugated systems. This eliminates infinite ping-pong double bond oscillations between carboxylate oxygens that previously hitmax_iter=200withUserWarning: The standardization could not be completed within a reasonable number of iterations.reorder_atomsinMDAnalysisInferrer.__call__so that it only runs when the molecule was converted from an AtomGroup with_MDAnalysis_index, preventing 1800+ spurious warning spams (UserWarning: '_MDAnalysis_index' not available on the input mol atoms, skipping reordering of atoms.) when inferring generic RDKit molecules.testsuite/MDAnalysisTests/converters/test_rdkit.pycovering carboxylates (CC(=O)[O-],c1ccccc1C(=O)[O-],NC(CC(=O)[O-])C(=O)[O-],[O-]C(=O)c1ccccc1C(=O)[O-],[O-]C(=O)/C=C/c1ccccc1,[O-]C(=O)/C=C/C(=O)[O-]) and asserting that generic molecules can be inferred without missing index warnings.package/AUTHORSandpackage/CHANGELOG.LLM / AI generated code disclosure
LLMs or other AI-powered tools (beyond simple IDE use cases) were used in this contribution: yes
PR Checklist
package/CHANGELOGfile updated?package/AUTHORS? (If it is not, add it!)Developers Certificate of Origin
I certify that I can submit this code contribution as described in the Developer Certificate of Origin, under the MDAnalysis LICENSE.