Algorithm Gromacs used for removing periodic boundary condition

GROMACS version: 2022.1
GROMACS modification: No

Does anyone know the algorithm that Gromacs used for removing periodic boundary condition in “trjconv” command?

I am using “gmx trjconv -pbc mol -ur compact -center” to remove periodic boundary condition, such that I could look at the protein in trajectory viewer. The system involves 2 chains. The trjconv command generate some frames with two chains on different sides of the box, instead of a “whole”.

I checked the Gromacs manual. I got confused about the -pbc options, and don’t know what they actually do. After that, I read the code about PBC in Gromacs.

In the code, I saw “graph” and “white/grey/black nodes” (e.g. in mshift.cpp file). It seems that Gromacs is using some “graph theory algorithm”. However, I cannot trace back the algorithm from it.

Could anyone tell me the algorithm (it would be great if a reference could be suggested), or tell what Gromacs actually did if I misunderstood.

Thank you.

Hi,
This is not a direct answer to your question. Just a suggestions

Maybe this workflow help to understand better the option https://manual.gromacs.org/current/user-guide/terminology.html#suggested-workflow

\Alessandra

Dear Alevilla,

I saw this manual section before. I got a sense of what is going on, but still not very clear. Thank you for your reply anyway.

Best,
Huiyu

Heya,

I have been working on a python program which solves this issue. Please take a look at the MDVWhole github repository, or simply run pip install mdvwhole in python 3.8+. It is made to make non-bonded objects whole over any PBC. It works for both single PDB/GRO files and trajectories. If you have any issues, please feel free to leave an issue at the Github page. Or we can discuss it here.

Cheers,

Bart

This is a common issue with clusters consisting of multiple molecules. The problem with trjconv is that it is unclear for the user in which order the operations happen. So you need to call trjconv multiple times with a single pbc option to be sure that things work. I think that what you want can be accomplished with the following three steps, feeding the resulting trajectory from one into the next:
gmx trjconv -pbc nojump
gmx trjconv -center
gmx trjconv -pbc mol -ur compact

2 Likes

I think this issue cannot reliably be solved using trjconv (in any combinations) at the moment in GMX. The -nojump only works if things maintain associated during the simulation. -center is not safe (can put things at the corners of the box for then COM is also in the center), -pbc mol only completes molecules and compact is just changing the box representation. I might be missing something, but I do not see how this can safely ‘fix’ broken dynamic aggregates.

-pbc nojump keep aggregates in the state the started in. If you then center on the aggregate , the aggrerate is still whole. The -pbc mol afterwards should then only affect all other molecules, as the aggregate should not be crossing box boundaries when it has been centered.

1 Like