How does trjconv work

GROMACS version:
GROMACS modification: Yes/No
Here post your question
In my trajectory some water molecules were bound to Mg ion in a protein pocket. I wanted to track the motion of theses water molecules and calculate their displacement in absence of these ions and protein. I used trjconv to remove the ion and protein but these water molecules still appears to be bound to something. I wanted to know how does trjconv work and is this the correct approach.

I’m not sure I understand what you mean. tjrconv will not change the environment of the water molecules if you remove the ion and protein. The water molecules will move exactly the same way - but there will be empty space in the trajectory where the removed molecules were located. trjconv does not change the trajectory.

Thank you. I also observe this but my question is this now the MG ion has been removed so why some water molecules still seems trapped inside a invisible cavity?
I want to look at the displacement of these water molecules where they are not trapped in a cavity.

Then you need to run another simulation without the MG ion (and protein). All waters in the current trajectory move as if the MG ion and protein were there. The trajectory does not change based on what you decide to show in it.

thank you for your support.