Strip solvent from trajectory - Cannot do both runtime modification and charge-zeroing/index

GROMACS version: 2021.3
GROMACS modification: No
Hello all!

I am trying to strip solvent from the MD trajectory. The command

gmx trjconv -s npt_prod.tpr -f npt_prod.xtc -n index.ndx -pbc nojump -o npt_prod_nowat_nojump.xtc

works as expected, selecting the option for the zinc ion and the protein, but

gmx convert-tpr -s npt_prod.tpr -n index.ndx -nsteps -1 -o npt_prod_nowat_nojump.tpr

does not work, giving the error “Cannot do both runtime modification and charge-zeroing/index group extraction in a single call.”

I do not understand this error, could anyone provide some help as to how to address this. Or is there a better way of stripping water molecules from the MD trajectory?


If you need a .tpr without water to use for further trjconv call, call convert-tpr without the nstep argument (gmx convert-tpr -s npt_prod.tpr -n index.ndx -o npt_prod_nowat_nojump.tpr), despite what the documentation says.

Hello @ebriand

Thank you for your response. I will try this.

Is there another way to generate a tpr file without solvent present?


Most generally, to remove anything you can edit the structure and topology file.

Eg, you could make a copy of your .gro and .top file, modify the .gro to remove all solvents (delete all line with “SOL” and update the atom count at the top of the file - 3*number of solvent) and modify the .top [molecule] section to remove the SOL line.