Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix potential bug in counterion implementation: get_water_indices() #1225

Open
zhang-ivy opened this issue Aug 9, 2023 · 0 comments
Open
Assignees

Comments

@zhang-ivy
Copy link
Contributor

zhang-ivy commented Aug 9, 2023

Iván and I caught a potential bug in the counterion implementation, specifically in get_water_indices(), which selects the water(s) to alchemically transform into counterion(s).

The function selects waters at least a certain distance from the solute atoms, and the solute atoms are defined as atoms in the topology that are not in mdtraj's _SOLVENT_TYPES:
https://github.com/choderalab/perses/blob/main/perses/utils/charge_changing.py#L88-L89

However, _SOLVENT_TYPES does not include all possible water residue names. It includes HOH, but does not include WAT, or other water residue names, so we should change this line https://github.com/choderalab/perses/blob/main/perses/utils/charge_changing.py#L88 to solvent_types = list(_SOLVENT_TYPES) + list(_WATER_RESIDUES). _WATER_RESIDUES can be imported from mdtraj and is present here: https://github.com/mdtraj/mdtraj/blob/master/mdtraj/core/residue_names.py#L45

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

No branches or pull requests

2 participants