# Wrapping trajectories in trjconv

**URL:** <https://gromacs.bioexcel.eu/t/wrapping-trajectories-in-trjconv/13025>\
**Category:** User discussions\
**Tags:** analysis-tools\
**Created:** [December 8, 2025, 9:14pm UTC](https://gromacs.bioexcel.eu/t/wrapping-trajectories-in-trjconv/13025 "2025-12-08T21:14:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![SinjiniB](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@SinjiniB](https://gromacs.bioexcel.eu/u/SinjiniB)\
**Post date:** [December 8, 2025, 9:14pm UTC](https://gromacs.bioexcel.eu/t/wrapping-trajectories-in-trjconv/13025/1 "2025-12-08T21:14:52Z")

</div>

Hi all,

I am trying to visualize the simulation of a multimeric protein in a octahedron box and I used several combinations of -pbc (whole, mol, no-jump) and -center but the waters are still not wrapped correctly. Is there any specific protocol to deal with the pbc wrapping of such systems?

Any help would be appreciated!

---

<div class="post-metadata">

**Author:** ![lmullender](https://avatars.discourse-cdn.com/v4/letter/l/8dc957/32.png) [@lmullender](https://gromacs.bioexcel.eu/u/lmullender)\
**Post date:** [December 9, 2025, 1:51pm UTC](https://gromacs.bioexcel.eu/t/wrapping-trajectories-in-trjconv/13025/2 "2025-12-09T13:51:36Z")

</div>

Hi! What exactly do you mean by “not wrapped correctly”? With an octahedral box, the `gmx trjconv -ur compact` option might be what you’re looking for.

---

<div class="post-metadata">

**Author:** ![SinjiniB](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@SinjiniB](https://gromacs.bioexcel.eu/u/SinjiniB)\
**Post date:** [December 10, 2025, 10:01pm UTC](https://gromacs.bioexcel.eu/t/wrapping-trajectories-in-trjconv/13025/3 "2025-12-10T22:01:04Z")

</div>

Hi, when I use -pbc whole or -pbc mol (with centering around a residue in the center of the multimeric system), some parts of the protein go out of the box.

I also tried using -pbc nojump before and after the centering but in both cases it completely messes up the waters and its all over the place.

---

<div class="post-metadata">

**Author:** ![lmullender](https://avatars.discourse-cdn.com/v4/letter/l/8dc957/32.png) [@lmullender](https://gromacs.bioexcel.eu/u/lmullender)\
**Post date:** [December 12, 2025, 10:23am UTC](https://gromacs.bioexcel.eu/t/wrapping-trajectories-in-trjconv/13025/4 "2025-12-12T10:23:31Z")

</div>

Ah okay, I’m not expert here but I would probably go with `-pbc mol -ur compact -center` then, using the entire protein for centering. That should prevent any weird jumps and make sure everything is wrapped correctly. You can center the view around a single residue later in the visualization software of your choice.

---

<div class="post-metadata">

**Author:** ![obZehn](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/obzehn/32/2629_2.png) [@obZehn](https://gromacs.bioexcel.eu/u/obZehn)\
**Post date:** [December 12, 2025, 11:18am UTC](https://gromacs.bioexcel.eu/t/wrapping-trajectories-in-trjconv/13025/5 "2025-12-12T11:18:30Z")

</div>

On top of what @lmullender suggested, then do another round with `-pbc cluster` to try to group the proteins back if you have PBCs issues. Run this after cleaning up with `-pbc mol -ur compact -center`, that is, on the output trajectory. Try also to use a `tpr` file as reference that is whole and close to a structure that you are trying to reconstruct (e.g. the one of energy minimization).

---

<div class="post-metadata">

**Author:** ![SinjiniB](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@SinjiniB](https://gromacs.bioexcel.eu/u/SinjiniB)\
**Post date:** [December 15, 2025, 11:22pm UTC](https://gromacs.bioexcel.eu/t/wrapping-trajectories-in-trjconv/13025/6 "2025-12-15T23:22:39Z")

</div>

Hello, Thanks I used -pbc whole first, then -pbc cluster around the protein chains only (which I defined using a custom ndx) followed by -pbc mol and centering around the protein chains and it worked for 195/200 of the frames. Only in a few the chains are still separated in space. I found out -pbc nojump is the step to avoid, especially if the chain indices are not continuous. Thanks for the suggestions!
