NaN values when calculating MSD with the -mol flag

GROMACS version: 2022.1
GROMACS modification: No

Dear users,

I’ve been trying to use gmx msd with the -mol flag to calculate the diffusion per lipid molecule of my membrane system. I set up the analysis as gmx msd -f traj_prot_memb.xtc -n index.ndx -s prot_memb.gro -lateral z -o MSD/msd.xvg -mol MSD/diff_mol.xvg, select the group POPC from my index file, and it runs smoothly without errors. But when I open either msd.xvg or diff_mol.xvg I get only NaN values, like this snippet of my results:

@ title “Mean Squared Displacement”
@ xaxis label “tau (ps)”
@ yaxis label “MSD (nm\S2\N)”
@TYPE xy
@ view 0.15, 0.15, 0.75, 0.85
@ legend on
@ legend box on
@ legend loctype view
@ legend 0.78, 0.8
@ legend length 2
@ s0 legend “D[ POPC] = -nan (+/- nan) (1e-5 cm^2/s)”
0.000 0
2000.000 -nan
4000.000 -nan
6000.000 -nan
8000.000 -nan
10000.000 -nan
12000.000 -nan
14000.000 -nan
16000.000 -nan
18000.000 -nan
20000.000 -nan
22000.000 -nan
24000.000 -nan

When I try to calculate the MSD for POPC without the -mol flag it works perfectly. Has anyone experienced something similar? I’ve made sure all my molecules are whole and I have tried with other components of the system as well (other lipids, ions, and water).

Thanks a lot in advance!

Hi,

I think this might be related to Clarify gmx msd -mw and -mol options (#3869) · Issues · GROMACS / GROMACS · GitLab. When using the -mol option the output is molecule center of mass based. When you don’t provide a TPR file the masses will all be 0. Try providing a TPR file to the command. Hopefully that will solve it. We should consider if the -mol option should require TPR file input.

Dear Magnus, thank you very much! That was exactly it! Generating a TPR file from the topologies I have solved the issue. As for your suggestion, I do think it would be nice to be able to use the -mol option without necessarily using the mass of the selected atoms.