# Trajectory processing with only water

**URL:** <https://gromacs.bioexcel.eu/t/trajectory-processing-with-only-water/635>\
**Category:** User discussions\
**Created:** [August 7, 2020, 3:03pm UTC](https://gromacs.bioexcel.eu/t/trajectory-processing-with-only-water/635 "2020-08-07T15:03:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjm91](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@mjm91](https://gromacs.bioexcel.eu/u/mjm91)\
**Post date:** [August 7, 2020, 3:03pm UTC](https://gromacs.bioexcel.eu/t/trajectory-processing-with-only-water/635/1 "2020-08-07T15:03:09Z")

</div>

GROMACS version:  
GROMACS modification: Yes/No  
Here post your question

Hi, I have a protein in water-TFE trajectory in xtc format (all\_pbc.xtc) and the corresponding tpr file (npt.tpr). I need to do some analysis on water molecules only. So, I extracted only water trajectory from the xtc using: gmx trjconv -f all\_pbc.xtc -s npt.tpr -o sol.xtc and select group-16(SOL). Now if I try to use: gmx trjconv -f sol.xtc -s npt.tpr -dump 0 and select SOL to get water molecules coordinates at t=0 ps, Gromacs is showing an error “Index[7441] 12376 is larger than the number of atoms in the  
trajectory file (12375). There is a mismatch in the contents  
of your -f, -s and/or -n files.” If I use: gmx trjconv -f sol.xtc -s npt.tpr -dump 0 and select say Protein or TFE as output groups I am getting an output gro file, which seems weird since sol.xtc does not contain trajectory information about anything other than water/SOL. Total number of atoms including protein+water+TFE+ions=17314, no of water atoms=12375,protein=434

But we do use a similar protocol in order to analyze just the protein trajectory and using npt.tpr we can dump any protein structure at a particular frame

So if anyone can help me with the error message and why I am getting it, that would be really helpful. Thanks in advance

---

<div class="post-metadata">

**Author:** ![Dr\_DBW](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/dr_dbw/32/42_2.png) [@Dr\_DBW](https://gromacs.bioexcel.eu/u/Dr_DBW)\
**Post date:** [August 9, 2020, 10:41pm UTC](https://gromacs.bioexcel.eu/t/trajectory-processing-with-only-water/635/2 "2020-08-09T22:41:57Z")

</div>

Did you regenerate the `.tpr` file so that it only contains water.

---

<div class="post-metadata">

**Author:** ![mjm91](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@mjm91](https://gromacs.bioexcel.eu/u/mjm91)\
**Post date:** [August 10, 2020, 8:03am UTC](https://gromacs.bioexcel.eu/t/trajectory-processing-with-only-water/635/3 "2020-08-10T08:03:20Z")

</div>

No Sir, I have not regenerated tpr containing only water

---

<div class="post-metadata">

**Author:** ![avilla](https://avatars.discourse-cdn.com/v4/letter/a/f1d935/32.png) [@avilla](https://gromacs.bioexcel.eu/u/avilla)\
**Post date:** [August 10, 2020, 8:44am UTC](https://gromacs.bioexcel.eu/t/trajectory-processing-with-only-water/635/4 "2020-08-10T08:44:59Z")

</div>

Hi  
With “gmx trjconv -f sol.xtc -s npt.tpr -dump 0”, you ask to analysis an xtc file with only waters using a system description tpr file with protein-TFE-Water.  
Thus you have select “Protein”, the program is selecting atoms " 1 2 3 4 …" of your system (that are the protein atoms according to tpr) but in your new trajectory sol.xtc those atoms are waters atoms (since you have removed protein and TFO). That is the reason of the output you got.  
The program just looks at the index numbers, does not do any check on the “atom type” and etc.  
An easy solution is to provide to the option “-s” a gro file (containing only waters ) in place of tpr file (or generate a new tpr file as previuosly suggested), it depends which type of analysis you would like to do.  
Alessandra

> **Summary**
>
> This text will be hidden

---

<div class="post-metadata">

**Author:** ![Dr\_DBW](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/dr_dbw/32/42_2.png) [@Dr\_DBW](https://gromacs.bioexcel.eu/u/Dr_DBW)\
**Post date:** [August 10, 2020, 10:13am UTC](https://gromacs.bioexcel.eu/t/trajectory-processing-with-only-water/635/5 "2020-08-10T10:13:34Z")

</div>

Have you now? That is what the issue is.

---

<div class="post-metadata">

**Author:** ![mjm91](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@mjm91](https://gromacs.bioexcel.eu/u/mjm91)\
**Post date:** [August 10, 2020, 11:06am UTC](https://gromacs.bioexcel.eu/t/trajectory-processing-with-only-water/635/6 "2020-08-10T11:06:56Z")

</div>

Dear avilla and DR\_DBW, thank you both for your clarification. Now I understand the problem that I was facing. Thanks for your help.
