Issue with correcting PBC for DNA Separation in GROMACS

GROMACS version: gromacs2024.3
Hello,
I am trying to correct PBC for a DNA system, but even after running the commands, I still see artifacts in the trajectory. Here’s what I did:

gmx trjconv -pbc whole -f traj.xtc -o step1.xtc -s topol.tpr (select system)
gmx trjconv -pbc nojump -f step1.xtc -o step2.xtc -s topol.tpr (select system)
gmx trjconv -pbc mol -center -ur compact -f step2.xtc -o final.xtc -s topol.tpr (select dna then system)

However, water molecules still appear scattered beyond the simulation box, as visible in the trajectory visualization.

Can anyone suggest how to fix the PBC issue for water molecules while maintaining a proper setup for DNA? Should I use additional options or change the sequence of commands?

I appreciate any help you can provide.

I don’t see the point in using -pbc nojump and then -pbc mol. It is also risky combining -pbc and -center (or most combinations of instructions) in the same command, since it can be difficult to know in what order it is applied.

Does it work better if you do:

gmx trjconv -pbc whole -f traj.xtc -o step1.xtc -s topol.tpr
gmx trjconv -pbc mol -f step1.xtc -o step2.xtc -s topol.tpr
gmx trjconv -center -ur compact -f step2.xtc -o final.xtc -s topol.tpr

?

Thank you so much for your reply. I will definitely try it.
I used the following command for two separate DNA strands. I would like to know your point of view.
gmx trjconv -f file.xtc -s file.tpr -pbc whole -o file_while.xtc
gmx trjconv -f file_while.xtc -s file.tpr -pbc cluster -o file_while_cluster.xtc
gmx trjconv -f file_while_cluster.xtc -f file.tpr -pbc mol -center -o file_while_cluster_center.xtc

I think that looks like a good sequence of commands. To be on the safe side, I’d recommend splitting the third:

gmx trjconv -f file_while_cluster.xtc -s file.tpr -f file.tpr -center -o file_while_cluster_center.xtc
gmx trjconv -f file_while_cluster_center.xtc -s file.tpr -pbc mol -o file_while_cluster_center_mol.xtc

As above, I’d also recommend always using the tpr file, if possible. Hopefully, you’ll get a suitable trajectory this way.

Also, keep in mind that most of these modifications are to get a trajectory that you think is easy to use/present visually, so the end goal may be different from case to case. For analyses, it’s usually enough to do -pbc nojump, if any treatment is needed at all.

Hello,
Thank you so much for your help. I tried to follow your command, but when I use two -f flags, I get the error: “In command-line option -f: Option specified multiple times.” Could you please clarify why we need to specify it twice? I always use -s file.tpr.

Furthermore, with -pbc cluster, the DNA strand usually stays within the box, and I do not encounter problems when using x3DNA for analysis. To ensure the two strands of DNA remain together, I always use gmx distance between two atoms in the two strands with file.xtc without modifications to confirm the PBC issue. Do you think using -pbc cluster might introduce any artificial data when performing x3DNA analysis?

Sorry, my mistake regarding the -f option. The .tpr file should only be specified once and with the -s option.

I don’t think -pbc cluster would cause any problems, but I can’t say for sure.

thank you so much.
Best regards,
Fatemeh,