Gmx select - selection residues from distance

GROMACS version: 2019.3
GROMACS modification: No
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


My system contains a spherical structure made of cholesterol, DSPC, PEG and ionizable lipid. I want to make an index file, which includes indexes for all atoms from the center of sphere to 18 nm radius. Could you please help me to make the index file?

Thank you.