The mean square displacement is calculated by dividing the region

Hi,I wanted to know how to divide the region and calculate the mean square displacement of the molecule in the region. I used GMX MSD to calculate the total mean square displacement of a molecule in the region over time. But what I really want to study is changes in a particular region.
e6e73dbdbd4c1817d4d99ffd11d54002

I think your best shot - if you want to use GROMACS - is to use gmx select to produce a time dependent index that groups the molecules of interest in that region of space, and then use this index to select the relevant molecules and calculate their MSD

Hello, I have used GMX select-on to select the region and specify the molecule (see figure) . But when I run MSD, there was an error“The index group does not consist of whole molecules,” so I tried to fix it with GMX trjconv-pbc, but GMX TRJCONV can only output a trace file, not an NDX file. So I would like to ask what should be done. Thank you.

How are you computing the MSD specifically, with what command? I think the MSD function should be able to calculate the MSD of single atoms as well.

The only problem I see is that I am not sure that you can calculate the MSD in a specific region of space, meaning that I guess that the index you provide will make gmx msd pick those atoms and stick with them. This means that if you select the group 1 in your pasted index ([ resname_O3_and_z>1.75_and_z<2.25_f0_t0.000 ]) then the MSD will be calculated only on those selected atoms during the trajectory of your simulations. Those atoms will eventually move outside of your defined box region. As such, I am not completely sure you can calculate the MSD in a specific region with gmx msd as the sub-volume of your box is ill-defined, that is, it has a changing number of atoms/molecules and my understanding of the Einstein formula used in gmx msd is that you select a number N of atoms and then the mean square displacements are calculated for those N particles along the trajectory. Also, I guess the MSD formula for the diffusion is really meaningful in the limit of “enough” particles averaged, and if your sub-volume is too small then the formula itself won’t provide much info. But I hope someone more experienced can help you with the tool because I can’t see now how you may strictly select only a part of your volume in a meaningful way (for the gmx msd tool).

The MSD I’m using is GMX msd -f -n -mol. I thought about what you said, and I think it makes sense, if I really want to start by choosing N molecules in a region and calculating their diffusion coefficients, rather than calculating the diffusion coefficient of a region (because the molecules in that region are variable) . What am I supposed to do? Thank you.

If you don’t have whole molecules in your selection you should not use the -mol option.

It depends. If you want to select - at a given time - the atoms present in a certain region of space, then you just select that time frame and that region, get the index of those molecules with gmx select and then use gmx msd by providing that index.

As @MagnusL said, if you don’t have whole molecules then you have to drop the -mol flag. If you want whole molecules, like pick the atoms in a certain region but also the rest of the molecule to which those atoms belong (even if the molecules crosse your smaller box defined boundaries) then you have to change the selection syntax with something like resname O3 and same residue as z > 1.75 or something similar, here you can find some help about the syntax of the selection tool.

However, I am a bit confused about getting any meaning out of it. If you select a bunch of molecules in a region in space and calculate the msd for them, they will be moving around and they may end up in regions where the local diffusivity is different, and as such you will average the MSD for molecules that are experiencing a different background, which I am not really sure it carries any meaning. On the contrary, if your point is really look at the MSD of a region in space, even if the molecules come and go, then I don’t think you can do this with gmx msd, but I may be mistaken. Actually, the meaning of the MSD formula itself is to average over time over a number of molecules, which is supposedly a constant; in this case I think you may want to look into other ways to compute locally the diffusivity, e.g. methods like these.