Skip to content

Commit

Permalink
Don't loop over original atoms when searching for ions. [ref #193]
Browse files Browse the repository at this point in the history
  • Loading branch information
lohedges committed Apr 22, 2021
1 parent d47b0a7 commit 45f50ca
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/BioSimSpace/Solvent/_solvent.py
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,10 @@ def _solvate(molecule, box, angles, shell, model, num_point,
water_ion_lines = []

with open("solvated_ions.gro", "r") as file:
for line in file:
# Only loop over lines that don't include the original
# system/molecule, since that might also include ions.
lines = file.readlines()[molecule.nAtoms()+2:]
for line in lines:
# This is a Sodium atom.
if _re.search("NA", line):
water_ion_lines.append(line)
Expand Down

0 comments on commit 45f50ca

Please sign in to comment.