[gmx-users] Density calculation
chris.neale at alum.utoronto.ca
Wed Apr 12 04:52:51 CEST 2017
You have not really defined what you want to obtain all that well. E.g. a mass density is mass per volume, but you seem to take issue with the volume definition. Do you just want to know the mass density in a region that is near the center of your cellulose? If so, you could use gmx traj to get positions of selected groups and then compute the density yourself. It should also not be too hard to center a region of the cellulose in the trajectory and modify the gmx density source code to compute only for a strip in x and y and then you look at the region of z near 0 that corresponds to your "pure" cellulose. In gmx 5.1.2 this would be the code starting at line 404 in src/gromacs/gmxana/gmx_density.c
for (n = 0; n < nr_grps; n++)
for (i = 0; i < gnx[n]; i++) /* loop over all atoms in index file */
z = x0[index[n][i]][axis];
where you might add something like:
if (x0[index[n][i]]<-0.5 || x0[index[n][i]]>0.5 || x0[index[n][i]]<-0.5 || x0[index[n][i]]>0.5) continue;
and then you'd probably have to also modify the code at line 389 to replace:
invvol = *nslices/(box[XX][XX]*box[YY][YY]*box[ZZ][ZZ])
invvol = *nslices/(1*1*box[ZZ][ZZ])
or something like that.
I did not test it, but I presume that would only add mass in a strip 1 nm wide along X and Y so that you could use gmx density to get a profile along Z.
No promises on the code changes... caveat emptor.... if I were doing this I would test it out thorougly on a box of pure water and perhaps also a lipid bilayer first (in those cases cutting down to 1 nm x 1 nm in X and Y should only increase the noise but not affect the mean profile).
Anyway, it's an idea for a way forward. You might even interest Mark in creating a tool that will compute density in a defined sub-volume.... now that I understand the issue it sounds like an interesting tool. Could use it also to compute things likt water in the interior of a protein, etc.
From: gromacs.org_gmx-users-bounces at maillist.sys.kth.se <gromacs.org_gmx-users-bounces at maillist.sys.kth.se> on behalf of Md. Imrul Reza Shishir <imrul.reza.shishir at gmail.com>
Sent: 11 April 2017 21:27:03
To: gmx-users at gromacs.org
Subject: [gmx-users] Density calculation
I want to calculate the density of cellulose fibril. My simulation system
is cellulose in a box of water and ions.
If i apply "gmx energy" after NPT simulation then i will get density of
total system which is lower than what expected because of water.
"gmx energy -f *.edr -s *.tpr -o density.xvg " select the group density
If i use "gmx density", i get the density distribution along a axis.
"gmx density -f *.xtc -s *.tpr -o density.xvg " select the group of atom
So, how i will get the density of selected group as an average of time
period or distribution.
Thanks in advance.
*Md Imrul Reza Shishir*
Gromacs Users mailing list
* Please search the archive at http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before posting!
* Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
* For (un)subscribe requests visit
https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or send a mail to gmx-users-request at gromacs.org.
More information about the gromacs.org_gmx-users