Correcting Periodicity in GMX

GROMACS version: 2018
GROMACS modification: Yes/No
I have corrected my xtc file using the -pbc nojump followed by -pbc mol command. Despite applying this correction, part of my molecule (no break) can still be found outside the simulation box. How do I bring the whole molecule back into the simulation box?

Thanks.

You did the PBC correction out of order. Make molecules whole first, then remove jumps.

Thanks for the reply. Recently, I came across this response made by you on the Researchgate website.

You need several iterations of trjconv. Using -pbc whole is just the first step, and has nothing to do with the fact that there are multiple oxalates; it just corrects any molecules that have “broken” across PBC. Then invoke trjconv -pbc nojump (you said yourself the molecules are jumping across boundaries), then -pbc mol to put everything back in the box.

Would it be okay to apply the correction as follows:

gmx trjconv -s em.tpr -f polymer.xtc -o polymer.whole.xtc -pbc whole

gmx trjconv -s em.tpr -f polymer.whole.xtc -o polymer.whole.nojump.xtc -pbc nojump

gmx trjconv -s em.tpr -f polymer.whole.nojump.xtc -o polymer.whole.nojump.mol.xtc -pbc mol

Will applying wrong corrections (molecule not inside the box) affect the calculation from gmx rdf?

Yes. http://manual.gromacs.org/current/user-guide/terminology.html#suggested-workflow

If the RDF is computed on a per-atom basis, no, but if you are doing anything dealing with molecules or their COM positions, yes.

Yes. http://manual.gromacs.org/current/user-guide/terminology.html#suggested-workflow

Thank you very much.

If the RDF is computed on a per-atom basis, no, but if you are doing anything dealing with molecules or their COM positions, yes.

Yes, we computed it on a per-atom basis [-selrpos atom] as shown below

gmx rdf -s em.tpr -f polymer.xtc -n index.ndx -o rdf.xvg -cn rdf_cn.xvg -b 500000 -selpros atom -seltype atom -pbc yes -excl yes -ref 18 -sel 21 22 23

By extension, I tried calculating the number of atoms at a specific distance (first peak + tolerance) contained in select_atom.dat using the gmx select option. will the wrong correction affect this too? The answer should be No since by default, it’s a per-atom basis ( -selrpos atom). See command below

gmx select -s em.tpr -f polymer.xtc -os number_selection_atom.xvg -of occupied_fraction_atom.xvg -olt lifetime_atom_out.xvg -sf select_atom.dat

You can easily test this yourself and compare the outcomes.

Thank you. I am just trying to maximize the limited computational power.

gmx trjconv -s em.tpr -f polymer.xtc -o polymer.whole.xtc -pbc whole

gmx trjconv -s em.tpr -f polymer.whole.xtc -o polymer.whole.nojump.xtc -pbc nojump

gmx trjconv -s em.tpr -f polymer.whole.nojump.xtc -o polymer.whole.nojump.mol.xtc -pbc mol

I have tried this workflow but my molecule is still outside (part outside and others at the box edge) the simulation box.

gmx trjconv -s em.tpr -f polymer.whole.nojump.xtc -o polymer.whole.nojump.mol.xtc -pbc mol -ur compact
Also, I tried this but got the same situation as above.

Please advise me on how to correct this issue!

To speed up trying out the various options as you work out what will give the appearance you are looking for process a coordinate file (.gro/.pdb) instead of the trajectory file (.xtc/.trr).

After each step load up the file into what ever visualisation software you are using and see how it has changed things.

I suspect that last -pbc mol step is what is breaking things again.

Thank you very much. I will try your suggestions