# Removing pbc effect

**URL:** <https://gromacs.bioexcel.eu/t/removing-pbc-effect/590>\
**Category:** User discussions\
**Created:** [July 28, 2020, 9:25pm UTC](https://gromacs.bioexcel.eu/t/removing-pbc-effect/590 "2020-07-28T21:25:02Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![marko](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@marko](https://gromacs.bioexcel.eu/u/marko)\
**Post date:** [July 28, 2020, 9:25pm UTC](https://gromacs.bioexcel.eu/t/removing-pbc-effect/590/1 "2020-07-28T21:25:02Z")

</div>

Hi all  
I use trjconv in 3 consecutive commands to remove pbc effect, however, after a half of the trajectory I still can observe some jumps. Could you help me out with this issue?  
Commands are as follows:  
gmx trjconv -s md.tpr -f md.trr -o md1.trr -center -pbc whole -n index.ndx  
gmx trjconv -s md.tpr -f md1.trr -o md2.trr -pbc nojump -n index.ndx  
gmx trjconv -s md.tpr -f md2.trr -o md3.trr -pbc mol -ur compact -n index.ndx  
Thank you.

---

<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:** [July 29, 2020, 5:51am UTC](https://gromacs.bioexcel.eu/t/removing-pbc-effect/590/2 "2020-07-29T05:51:26Z")

</div>

> `compact` puts all atoms at the closest distance from the center of the box.  
> `mol` puts the center of mass of molecules in the box

So you removed the jumping molecules in step 2, then reintroduced it again in 3.

I’d recommend taking things one step at a time, visualise it after each step, then identify exactly what you want to do.

---

<div class="post-metadata">

**Author:** ![marko](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@marko](https://gromacs.bioexcel.eu/u/marko)\
**Post date:** [July 29, 2020, 3:31pm UTC](https://gromacs.bioexcel.eu/t/removing-pbc-effect/590/3 "2020-07-29T15:31:23Z")

</div>

Thank you for your reply. Could you give me the commands which solved the issue? I tried different ways but not effective. It takes a lot of time to test all the ways, download the trajectories and visualize them.

---

<div class="post-metadata">

**Author:** ![joshhayden](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@joshhayden](https://gromacs.bioexcel.eu/u/joshhayden)\
**Post date:** [July 29, 2020, 6:40pm UTC](https://gromacs.bioexcel.eu/t/removing-pbc-effect/590/4 "2020-07-29T18:40:24Z")

</div>

Does the protein you are simulating have multiple chains?

---

<div class="post-metadata">

**Author:** ![marko](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@marko](https://gromacs.bioexcel.eu/u/marko)\
**Post date:** [July 29, 2020, 6:58pm UTC](https://gromacs.bioexcel.eu/t/removing-pbc-effect/590/5 "2020-07-29T18:58:38Z")

</div>

Yes it does. What should I do for that?

---

<div class="post-metadata">

**Author:** ![joshhayden](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@joshhayden](https://gromacs.bioexcel.eu/u/joshhayden)\
**Post date:** [July 29, 2020, 8:53pm UTC](https://gromacs.bioexcel.eu/t/removing-pbc-effect/590/6 "2020-07-29T20:53:03Z")

</div>

Your commands are possibly not working because they centre the protein based on the centre of mass, which is the same point if the chains are together or wrapped over the periodic boundary conditions.

What you should try is making an index group using ‘gmx make\_ndx’ that contains the atom numbers of one of the protein chains. Let’s say you name the index file “chain\_index.ndx”.

Then try the following command (using your original trajectory as the input):

gmx trjconv -s md.tpr -f md.trr -n chain\_index.ndx -pbc mol -ur compact -center -o md1.trr

Choose the group you made containing the atoms of one of the chains for centering and then “System” for output. Hopefully that works!

---

<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:** [July 29, 2020, 10:54pm UTC](https://gromacs.bioexcel.eu/t/removing-pbc-effect/590/7 "2020-07-29T22:54:17Z")

</div>

For testing make a smaller trajectory, say putting out every 10th or more frames, and use that for testing.

---

<div class="post-metadata">

**Author:** ![marko](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@marko](https://gromacs.bioexcel.eu/u/marko)\
**Post date:** [July 31, 2020, 4:02pm UTC](https://gromacs.bioexcel.eu/t/removing-pbc-effect/590/8 "2020-07-31T16:02:05Z")

</div>

I did so. It just centers chain A. Chains B and C are still apart! Would it affect the rmsd and mmpbsa calculations?

---

<div class="post-metadata">

**Author:** ![marko](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@marko](https://gromacs.bioexcel.eu/u/marko)\
**Post date:** [July 31, 2020, 4:02pm UTC](https://gromacs.bioexcel.eu/t/removing-pbc-effect/590/9 "2020-07-31T16:02:59Z")

</div>

Yeah, I skip every 100 frames. But still takes time!

---

<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:** [July 31, 2020, 11:59pm UTC](https://gromacs.bioexcel.eu/t/removing-pbc-effect/590/10 "2020-07-31T23:59:41Z")

</div>

Then reduce further.

Note, you need to use the reduced trajectory for testing, not reprocess the original trajectory every time with the skip.

You really only need a couple of frames, ones that exhibit the visual artifact you are attempting to remove.

---

<div class="post-metadata">

**Author:** ![L\_k](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@L\_k](https://gromacs.bioexcel.eu/u/L_k)\
**Post date:** [September 5, 2020, 12:46pm UTC](https://gromacs.bioexcel.eu/t/removing-pbc-effect/590/11 "2020-09-05T12:46:25Z")

</div>

Hello @marko,

I have been using a similar approach to remove the pbc effect. I was wondering if you have resolved this issue. Previously, what has worked for me were the following:

1. gmx trjconv -s protein.tpr -f protein.xtc -o protein.whole.xtc -pbc whole

2. gmx trjconv -s protein.tpr -f protein.whole.xtc -o protein.whole.nojump.xtc -pbc nojump

3. gmx trjconv -s protein.tpr -f protein.whole.nojump.xtc -o protein.whole.nojump.mol.xtc -pbc mol -center

But I have reached a point where these are no longer working and there are jumps. I was wondering what your final approach to resolving this is?

Thank you.

---

<div class="post-metadata">

**Author:** ![alevilla](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/alevilla/32/439_2.png) [@alevilla](https://gromacs.bioexcel.eu/u/alevilla)\
**Post date:** [December 10, 2020, 9:44am UTC](https://gromacs.bioexcel.eu/t/removing-pbc-effect/590/12 "2020-12-10T09:44:48Z")

</div>

Hi,  
what about to try

1. -nojump
2. -center

Best regards  
Alessandra

---

<div class="post-metadata">

**Author:** ![L\_k](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@L\_k](https://gromacs.bioexcel.eu/u/L_k)\
**Post date:** [December 28, 2020, 7:46pm UTC](https://gromacs.bioexcel.eu/t/removing-pbc-effect/590/13 "2020-12-28T19:46:43Z")

</div>

Hello @alevilla ,

Thank you, this worked for some of the files but now I am running into a similar error. This time, -pbc whole helped to resolve this but now -pbc whole will not make my protein whole. Essentially, my protein is split in half and after applying whole there is still only two halves. And then if I apply nojump or cluster there is a split down the center of my protein causing calculation errors. Have you run into any similar issues before?

Again, thank you for the help in my previous post!

---

<div class="post-metadata">

**Author:** ![pragya004](https://avatars.discourse-cdn.com/v4/letter/p/e47774/32.png) [@pragya004](https://gromacs.bioexcel.eu/u/pragya004)\
**Post date:** [April 3, 2023, 5:40pm UTC](https://gromacs.bioexcel.eu/t/removing-pbc-effect/590/14 "2023-04-03T17:40:23Z")

</div>

@marko Could you please tell me how you were able to resolve this PBC issue. As I am also facing a similar issue after removing the PBC condition at certain frames, specific two chains along with ligand are jumping out. How did you resolve this issue? Please share.
