Using dynamic indices for outputting cluster centroids

GROMACS version:2024.2
GROMACS modification: Yes/No

Hi,

I’m analyzing different conformations that a protein-ligand complex adopts by clustering my production trajectory. An important part of this complex is a structural water molecule that mediates an interaction between the protein and the ligand. While the residence time of this interaction is quite high, the water molecule does get replaced many times by others during the simulation.

I am doing my clustering by fitting on the protein-ligand complex, but I would like to output the complex and the structural water as the centroids, which requires me to use a dynamic selection as each water molecule eventually diffuses.

I tried using gmx select -f md.xtc -s md.tpr -n index -on dynamic_index.ndx with the selection group Complex or (group Water and within 0.3 of group Complex) to achieve this. What I get in my newly created index is a group per frame in my simulation instead of a single group that updates itself for every frame, therefore I cannot use it to output my complex with local waters.

Is there a simpler way to do this that I am missing? Any suggestion will be highly appreciated.

Cheers,
Fernando