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.

@ebriand Hello, sorry for the very delayed response. So far I have removed all ions (except the Zn2+) ion from the production .gro file. Amended the count at the top of the file. But how do I generate a new .tpr file? I have tried using grompp but my .mdp file contains two groups Protein_Zn and Water_and_ions, obviously, I want to remove the water and some ions, so I am not sure how to amend further.

Also when I come to view the system in Chimera using gmx convert-tpr without -nsteps I also get an error, so maybe this part is important?

Use convert-tpr with the same index group that you saved from the trajectory and write a new one.

gmx convert-tpr -s full.tpr -o subset.tpr -n index.ndx

@jalemkul Excellent, thank you! Not sure why I didn’t opt to use that method.