# Removing jumps from the simulation trajectory

**URL:** <https://gromacs.bioexcel.eu/t/removing-jumps-from-the-simulation-trajectory/9447>\
**Category:** User discussions\
**Created:** [June 19, 2024, 8:26pm UTC](https://gromacs.bioexcel.eu/t/removing-jumps-from-the-simulation-trajectory/9447 "2024-06-19T20:26:37Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elahe](https://avatars.discourse-cdn.com/v4/letter/e/e68b1a/32.png) [@Elahe](https://gromacs.bioexcel.eu/u/Elahe)\
**Post date:** [June 19, 2024, 8:26pm UTC](https://gromacs.bioexcel.eu/t/removing-jumps-from-the-simulation-trajectory/9447/1 "2024-06-19T20:26:37Z")

</div>

Hello, dear gromacs users.  
I have a question about removing jumps from the simulation trajectory in Gromacs.

I did the membrane-drug simulation in Gromacs, but the drug has a lot of jumps, which I realized is related to pbc.

First, I used the following command, and it did not work.  
gmx trjconv -f output.xtc -s output.tpr -o md\_noPBC.xtc -pbc mol -ur compact

Then I tried to remove these jumps with the following commands:

gmx trjconv - f output.xtc - s output.tpr - o new1.xtc - pbc whole (select system)

gmx trjconv - f new1.xtc - s output.tpr - o new2.xtc - pbc nojump (select system)

gmx trjconv - f new2.xtc - s output.tpr - o new3.xtc - pbc cluster - center yes (select drug for cluster and center, select system for output)

And I did not get an answer again. I wanted to get help to solve this problem. Is there another way to do this?

---

<div class="post-metadata">

**Author:** ![scinikhil](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/scinikhil/32/3483_2.png) [@scinikhil](https://gromacs.bioexcel.eu/u/scinikhil)\
**Post date:** [June 20, 2024, 3:31pm UTC](https://gromacs.bioexcel.eu/t/removing-jumps-from-the-simulation-trajectory/9447/2 "2024-06-20T15:31:26Z")

</div>

which one shows issue? membrane or drug?

---

<div class="post-metadata">

**Author:** ![Elahe](https://avatars.discourse-cdn.com/v4/letter/e/e68b1a/32.png) [@Elahe](https://gromacs.bioexcel.eu/u/Elahe)\
**Post date:** [June 20, 2024, 3:36pm UTC](https://gromacs.bioexcel.eu/t/removing-jumps-from-the-simulation-trajectory/9447/3 "2024-06-20T15:36:54Z")

</div>

Thank you. The drug has jumps.

---

<div class="post-metadata">

**Author:** ![scinikhil](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/scinikhil/32/3483_2.png) [@scinikhil](https://gromacs.bioexcel.eu/u/scinikhil)\
**Post date:** [June 20, 2024, 3:41pm UTC](https://gromacs.bioexcel.eu/t/removing-jumps-from-the-simulation-trajectory/9447/4 "2024-06-20T15:41:08Z")

</div>

you need to approach multiple step like you did above. once you got the membrane fixed. work on drug starting from -pbc mol -center -ur compact and select drug for making it center. if that didnt fix please share the image.

---

<div class="post-metadata">

**Author:** ![FreaX\_997](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/freax_997/32/2031_2.png) [@FreaX\_997](https://gromacs.bioexcel.eu/u/FreaX_997)\
**Post date:** [June 21, 2024, 6:01am UTC](https://gromacs.bioexcel.eu/t/removing-jumps-from-the-simulation-trajectory/9447/5 "2024-06-21T06:01:11Z")

</div>

Hey @Elahe !

I am facing the exact same issue. Can you tell me how long your simulation was and at what point in the simulation did the drug start jumping?

I ran a 200 ns protein-ligand simulation and the drug started jumping around only in the final 50-60 ns of the simulation.

---

<div class="post-metadata">

**Author:** ![Elahe](https://avatars.discourse-cdn.com/v4/letter/e/e68b1a/32.png) [@Elahe](https://gromacs.bioexcel.eu/u/Elahe)\
**Post date:** [June 21, 2024, 6:55am UTC](https://gromacs.bioexcel.eu/t/removing-jumps-from-the-simulation-trajectory/9447/6 "2024-06-21T06:55:13Z")

</div>

Hi @FreaX_997  
Thanks for your attention.  
I also ran for 100 ns. In the first 30 ns, the drug has 3-4 jumps. but in the last 30 ns, it has alot of junps and the last 20 ns completely placed in the down of lower leaflet the membrane.

 ![60ns](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/d/de18891ec84032a1e8d881de6200fcffeb991070.jpeg)  
 ![40 ns](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/8/8f10ee30faebc98557613856cd64e64b06b3603b.jpeg)  
 ![80ns](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/a/a495d4ac0178bc404a619e9eb35273bb6f7ccbb6.jpeg)

---

<div class="post-metadata">

**Author:** ![Elahe](https://avatars.discourse-cdn.com/v4/letter/e/e68b1a/32.png) [@Elahe](https://gromacs.bioexcel.eu/u/Elahe)\
**Post date:** [June 21, 2024, 6:57am UTC](https://gromacs.bioexcel.eu/t/removing-jumps-from-the-simulation-trajectory/9447/7 "2024-06-21T06:57:18Z")

</div>

Thanks, I will try it and share the result.

---

<div class="post-metadata">

**Author:** ![FreaX\_997](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/freax_997/32/2031_2.png) [@FreaX\_997](https://gromacs.bioexcel.eu/u/FreaX_997)\
**Post date:** [June 21, 2024, 7:29am UTC](https://gromacs.bioexcel.eu/t/removing-jumps-from-the-simulation-trajectory/9447/8 "2024-06-21T07:29:43Z")

</div>

Hey @scinikhil

I tried this approach but it did not work.

FYI: It’s just the ligand (drug molecule) which is showing the jumps for me. The protein is fine.

---

<div class="post-metadata">

**Author:** ![rpsingh](https://avatars.discourse-cdn.com/v4/letter/r/c57346/32.png) [@rpsingh](https://gromacs.bioexcel.eu/u/rpsingh)\
**Post date:** [June 26, 2024, 1:21pm UTC](https://gromacs.bioexcel.eu/t/removing-jumps-from-the-simulation-trajectory/9447/9 "2024-06-26T13:21:25Z")

</div>

I have faced a similar problem. The molecule of interest was placed above the lipid bilayer, it crossed the top of the box and, due to PBC, appeared from below the box. This resulted in molecule being present towards the inner leaflet. This gave an illusion that the molecule has crossed the membrane (when comparing the start and end snapshots of simulation) while it actually hadn’t. I was wondering if this could be fixed?

Thanks,  
Raman

---

<div class="post-metadata">

**Author:** ![MagnusL](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/magnusl/32/2380_2.png) [@MagnusL](https://gromacs.bioexcel.eu/u/MagnusL)\
**Post date:** [June 26, 2024, 2:06pm UTC](https://gromacs.bioexcel.eu/t/removing-jumps-from-the-simulation-trajectory/9447/10 "2024-06-26T14:06:49Z")

</div>

Doesn’t it work if you just do:

```auto
gmx trjconv -f traj.xtc -s topol.tpr -o traj_nojump.xtc -pbc nojump (select system)

```

?  
If the molecules were broken across the periodic boundary at the start, you might need to do:

```auto
gmx trjconv -f traj.xtc -s topol.tpr -o traj_whole.xtc -pbc whole (select system)
gmx trjconv -f traj_whole.xtc -s topol.tpr -o traj_whole_nojump.xtc -pbc nojump (select system)

```

---

<div class="post-metadata">

**Author:** ![MagnusL](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/magnusl/32/2380_2.png) [@MagnusL](https://gromacs.bioexcel.eu/u/MagnusL)\
**Post date:** [June 26, 2024, 2:09pm UTC](https://gromacs.bioexcel.eu/t/removing-jumps-from-the-simulation-trajectory/9447/11 "2024-06-26T14:09:47Z")

</div>

If you need to make sure the molecule of interest does not reach the inner leaflet without permeating the membrane, you should make a stacked mirrored image of the system - so that the interior and exterior are separated.

---

<div class="post-metadata">

**Author:** ![Elahe](https://avatars.discourse-cdn.com/v4/letter/e/e68b1a/32.png) [@Elahe](https://gromacs.bioexcel.eu/u/Elahe)\
**Post date:** [June 27, 2024, 7:53am UTC](https://gromacs.bioexcel.eu/t/removing-jumps-from-the-simulation-trajectory/9447/12 "2024-06-27T07:53:44Z")

</div>

> [@rpsingh](#):
>
> The molecule of interest was placed above the lipid bilayer, it crossed the top of the box and, due to PBC, appeared from below the box. This resulted in molecule being present towards the inner leaflet.

Dear Raman  
My simulation has the same situation as you described and I still haven’t been able to find a solution to it.

---

<div class="post-metadata">

**Author:** ![Elahe](https://avatars.discourse-cdn.com/v4/letter/e/e68b1a/32.png) [@Elahe](https://gromacs.bioexcel.eu/u/Elahe)\
**Post date:** [June 27, 2024, 8:01am UTC](https://gromacs.bioexcel.eu/t/removing-jumps-from-the-simulation-trajectory/9447/13 "2024-06-27T08:01:22Z")

</div>

Dear @MagnusL thanks for your attention  
it doesn’t work.

> [@MagnusL](#):
>
> Doesn’t it work if you just do:
> 
> ```auto
> gmx trjconv -f traj.xtc -s topol.tpr -o traj_nojump.xtc -pbc nojump (select system)
> 
> ```
> 
> ?

I will try it. Isn’t there a need for the -center?

> [@MagnusL](#):
>
> If the molecules were broken across the periodic boundary at the start, you might need to do:
> 
> ```auto
> gmx trjconv -f traj.xtc -s topol.tpr -o traj_whole.xtc -pbc whole (select system)
> gmx trjconv -f traj_whole.xtc -s topol.tpr -o traj_whole_nojump.xtc -pbc nojump (select system)
> 
> ```

---

<div class="post-metadata">

**Author:** ![Elahe](https://avatars.discourse-cdn.com/v4/letter/e/e68b1a/32.png) [@Elahe](https://gromacs.bioexcel.eu/u/Elahe)\
**Post date:** [June 27, 2024, 8:04am UTC](https://gromacs.bioexcel.eu/t/removing-jumps-from-the-simulation-trajectory/9447/14 "2024-06-27T08:04:08Z")

</div>

Is it possible to guide us on how to do this?

---

<div class="post-metadata">

**Author:** ![MagnusL](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/magnusl/32/2380_2.png) [@MagnusL](https://gromacs.bioexcel.eu/u/MagnusL)\
**Post date:** [June 27, 2024, 8:46am UTC](https://gromacs.bioexcel.eu/t/removing-jumps-from-the-simulation-trajectory/9447/15 "2024-06-27T08:46:11Z")

</div>

You only need `-center` if you wish to center something in the simulation box. My reply just addressed what was explicitly requested, i.e., to remove jumps from the trajectory. I think it’s good to do things one step at a time and try to decide what you want to do with your trajectory. It is always risky to use examples from someone else.

Does this part of the manual help you [Terminology - GROMACS 2024.2 documentation](https://manual.gromacs.org/current/user-guide/terminology.html#periodic-boundary-conditions)?

EDIT: I realised that my answer a few posts above will not work if the molecules are broken in the tpr. Follow the instructions in the manual in that case.

---

<div class="post-metadata">

**Author:** ![rpsingh](https://avatars.discourse-cdn.com/v4/letter/r/c57346/32.png) [@rpsingh](https://gromacs.bioexcel.eu/u/rpsingh)\
**Post date:** [June 27, 2024, 4:46pm UTC](https://gromacs.bioexcel.eu/t/removing-jumps-from-the-simulation-trajectory/9447/16 "2024-06-27T16:46:12Z")

</div>

Does that mean I need to use a double bilayer and place the molecule between the two bilayers?

---

<div class="post-metadata">

**Author:** ![scinikhil](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/scinikhil/32/3483_2.png) [@scinikhil](https://gromacs.bioexcel.eu/u/scinikhil)\
**Post date:** [June 27, 2024, 5:24pm UTC](https://gromacs.bioexcel.eu/t/removing-jumps-from-the-simulation-trajectory/9447/17 "2024-06-27T17:24:03Z")

</div>

what was the length of your water box?

---

<div class="post-metadata">

**Author:** ![MagnusL](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/magnusl/32/2380_2.png) [@MagnusL](https://gromacs.bioexcel.eu/u/MagnusL)\
**Post date:** [June 28, 2024, 10:53am UTC](https://gromacs.bioexcel.eu/t/removing-jumps-from-the-simulation-trajectory/9447/18 "2024-06-28T10:53:10Z")

</div>

I don’t know what the goal with your simulation is, so it is difficult to say.

You don’t need to use a double bilayer just to avoid molecules jumping across the periodic boundary when you view the trajectory, such visualisation artefacts can be resolved using `gmx trjconv`. But if you want to make sure that the molecule does not reach the other side of the bilayer without crossing the bilayer, you will need two bilayers (mirrored if they are not symmetric). With one bilayer in the simulation, the solvent is continuous.

---

<div class="post-metadata">

**Author:** ![rpsingh](https://avatars.discourse-cdn.com/v4/letter/r/c57346/32.png) [@rpsingh](https://gromacs.bioexcel.eu/u/rpsingh)\
**Post date:** [June 28, 2024, 12:55pm UTC](https://gromacs.bioexcel.eu/t/removing-jumps-from-the-simulation-trajectory/9447/19 "2024-06-28T12:55:17Z")

</div>

Thank you @MagnusL. Indeed I have an asymmetric membrane. gmx trjconv was not helpful so I was looking for alternatives. I will try with the two bilayers.

@scinikhil The water box was more than 15 nm on either side of the membrane. Simulation time was 500 ns.
