Skip to content

[ WIP ] Support for charge changes in the HybTop protocol for explicitly solvated systems#1978

Open
hannahbaumann wants to merge 5 commits into
mainfrom
membrane_charge_change
Open

[ WIP ] Support for charge changes in the HybTop protocol for explicitly solvated systems#1978
hannahbaumann wants to merge 5 commits into
mainfrom
membrane_charge_change

Conversation

@hannahbaumann
Copy link
Copy Markdown
Contributor

@hannahbaumann hannahbaumann commented May 18, 2026

This is just a first idea (and the _get_ion_resnames_from_topology was written together with Claude). This is mostly just to show the different things we have to consider, but I don't like the dictionary idea of known ions yet. Maybe it would also be ok to always use Cl and Na ions for explicitly solvated systems, no matter if other ion types were used as counterions?

Checklist

  • All new code is appropriately documented (user-facing code must have complete docstrings).
  • Added a news entry, or the changes are not user-facing.
  • Ran pre-commit: you can run pre-commit locally or comment on this PR with pre-commit.ci autofix.

Manual Tests: these are slow so don't need to be run every commit, only before merging and when relevant changes are made (generally at reviewer-discretion).

Developers certificate of origin

"""
Infer positive and negative ion residue names from a topology by
finding the most common monovalent ion of each charge type.
Falls back to NA/CL if none are found.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm doing this mostly because e.g. maestro doesn't always add ions (in the a2a example there were no negative ions in the system).

@hannahbaumann
Copy link
Copy Markdown
Contributor Author

pre-commit.ci autofix

system_mapping: dict,
charge_difference: int,
solvent_component: SolventComponent,
positive_ion_resname: str,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use element or formal charge instead?

@IAlibay IAlibay self-requested a review May 21, 2026 14:12
@hannahbaumann
Copy link
Copy Markdown
Contributor Author

pre-commit.ci autofix

@github-actions
Copy link
Copy Markdown

No API break detected ✅

@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

❌ Patch coverage is 97.16981% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.54%. Comparing base (cb10892) to head (f508d34).

Files with missing lines Patch % Lines
...protocols/openmm_rfe/_rfe_utils/topologyhelpers.py 95.08% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1978      +/-   ##
==========================================
- Coverage   94.94%   90.54%   -4.40%     
==========================================
  Files         216      216              
  Lines       20481    20547      +66     
==========================================
- Hits        19445    18604     -841     
- Misses       1036     1943     +907     
Flag Coverage Δ
fast-tests 90.54% <97.16%> (?)
slow-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HybridTopologyProtocol does not allow for net charge transformation when running with a membrane

2 participants