Gmx select - selection residues from distance

GROMACS version: 2019.3
GROMACS modification: No
Hi,
I work on lipid structure interacting with water solution. I have to select every water (group 1 in index file) that is situated below 4A from the lipid (group 2), so the command has been used:

gmx select -f input.gro -s input.tpr -n input.ndx -select ‘group 1 and within 0.4 of group 2’ -on output.ndx

This literally selected me every water ATOM from that distance, but left single structures like H or OH. I cannot figure out how to select all waters (all water residues) from that area and save all as index file. Is the other way to select all water residues from presented group?
Thanks in advance

You can use the same residue as syntax to get the whole residue based on the atoms the match the criteria.

1 Like