Clarification of "gmx density" output

Hi all,

I have a question about the output of the “gmx density”.
If we include the options “-d X/Y/Z”, the output is the distribution of the density along that axis, respectively. It means the horizontal axis, named “coordinate” in the .xvg file, is the axis X/Y or Z.

If we don’t include, the coordinate is automatically the radius, isn’t it?

And, for our project, we need to determine the density distribution of our protein, along its symmetrical axis. Is there anyway to do it?

Thanks a lot, in advance!
I’d greatly appreciate your guidance.

Anh T. Mai

gmx density does not take a radial density, it simply computes the density as a function of slices along the specified axis.

Hi Dr. Lemkul,
Thanks for your reply.

So, is the Z-axis automatically in use when the option is not specified, i.e. when the “-d X/Y/Z” is not included in the command?
And, are the slices along the X and the Y axes are automatically picked to be the same values?

I made that guess based on our output, but not 100% sure.
For example, we run these four commands on the same target trajectory, to compute the density of Water group (TIP3P216 model), based on the center of the Protein Group.
(1) gmx density -f full.xtc -n index.ndx -s full.tpr -o density_water_?.xvg -center
(2) gmx density -f full.xtc -n index.ndx -s full.tpr -o density_water_X.xvg -center -d X
(3) gmx density -f full.xtc -n index.ndx -s full.tpr -o density_water_Y.xvg -center -d Y
(4) gmx density -f full.xtc -n index.ndx -s full.tpr -o density_water_Z.xvg -center -d Z

And here are the output respectively,
(First column is “Position in nm”, and the second is “Density in kgm^(-3)”.)
(1) Not including -d
“…
-0.718345 903.513
-0.513104 896.691
-0.307862 894.742
-0.102621 895.902
0.102621 899.714
0.307862 906.809
0.513104 916.62
0.718345 926.764
…”

(2) -d X
“…
-0.725637 1000.32
-0.435382 994.195
-0.145127 985.958
0.145127 975.246
0.435382 964.859
0.725637 956.03
…”

(3) -d Y
“…
-0.725637 998.933
-0.435382 996.412
-0.145127 993.013
0.145127 988.584
0.435382 982.933
0.725637 976.22
…”

(4) -d Z
“…
-0.718345 903.513
-0.513104 896.691
-0.307862 894.742
-0.102621 895.902
0.102621 899.714
0.307862 906.809
0.513104 916.62
0.718345 926.764
…”

Thanks,
Anh

Yes, that is the default behavior, per the help information:

So you get exactly the same outcome with -d Z or without it. The other calculations apply to different axes as requested.

Yes. Thank you, Dr. Lemkul.