Open zhang-ivy opened 11 months ago
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).
get_water_indices()
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
_SOLVENT_TYPES
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
solvent_types = list(_SOLVENT_TYPES) + list(_WATER_RESIDUES)
_WATER_RESIDUES
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-L89However,
_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 tosolvent_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