[gmx-users] problem with g_density -center

chris.neale at utoronto.ca chris.neale at utoronto.ca
Sun Aug 21 01:30:32 CEST 2011


g_density is not compatible with constant pressure simulations. You  
must modify it to construct the bins outward from the bilayer center  
when doing NPT:

http://lists.gromacs.org/pipermail/gmx-users/2010-November/055651.html

Further, trjconv -center is misleading. I actually lost a lot of time  
thinking that trjconv -center would center the COM when it actually  
centers the value of (max-min)/2:

http://www.mail-archive.com/gmx-users@gromacs.org/msg41681.html

The short of it is that there are no out-of-the-box tools to construct  
the density profile along the normal to a bilayer when the z-dimension  
can fluctuate.

You can probably use the trjconv -center (COM) patch after resetting  
the box in the following scheme. I used this to create input for  
g_spatial, but I suspect that the distribution version of g_density  
would also work fine on these files. Note that the only non-standard  
thing about this processing is that I applied the trjconv patch to  
which I referred above. The idea is to make the box larger than it was  
in any of the frames but of a constant size and then center everything  
taking careful control of pbc.

rm -rf TEMPORARY_FILES
mkdir -p TEMPORARY_FILES
echo "KSC_DOPC" | trjconv -f bothsides_center_adjusted_*.xtc -o  
/dev/shm/tmp.xtc -n cn.ndx

GMXLIB=/project/pomes/cneale/GPC/exe/intel/gromacs-4.5.3_modtrjconv/exec/share/gromacs/top
echo "NE_CZ_NH1_NH2_CB_CG_CD System" |  
/project/pomes/cneale/GPC/exe/intel/gromacs-4.5.3_modtrjconv/exec/bin/trjconv  
-center -pbc mol -f /dev/shm/tmp.xtc -o /dev/shm/tmp2.xtc -s  
../../useful/dry.tpr -n cn.ndx
mv /dev/shm/tmp.xtc TEMPORARY_FILES

echo "DOPC System" |  
/project/pomes/cneale/GPC/exe/intel/gromacs-4.5.3_modtrjconv/exec/bin/trjconv  
-center -pbc atom -f /dev/shm/tmp2.xtc -o /dev/shm/tmp3.xtc -s  
../../useful/dry.tpr -n cn.ndx
mv /dev/shm/tmp2.xtc TEMPORARY_FILES

## now make a new .tpr file in which the solute is at the center of the box
#first output a single frame
echo "NE_CZ_NH1_NH2_CB_CG_CD System" |  
/project/pomes/cneale/GPC/exe/intel/gromacs-4.5.3_modtrjconv/exec/bin/trjconv  
-f /dev/shm/tmp3.xtc -dump 125000 -o /dev/shm/tmpgro.gro -s  
../../useful/dry.tpr -center -pbc mol -n cn.ndx
#make a new .tpr file
touch empty.mdp
/project/pomes/cneale/GPC/exe/intel/gromacs-4.5.3_modtrjconv/exec/bin/grompp  
-p  
/project/pomes/cneale/GPC/fromScratch/ARG/MANY_RUNS/TEMPLATE/FILES/complete_dry.top -c /dev/shm/tmpgro.gro -f empty.mdp -o centered.tpr -maxwarn  
1

echo "NE_CZ_NH1_NH2_CB_CG_CD System" |  
/project/pomes/cneale/GPC/exe/intel/gromacs-4.5.3_modtrjconv/exec/bin/trjconv  
-fit transxy -pbc atom -f /dev/shm/tmp3.xtc -o /dev/shm/tmp4.xtc -s  
centered.tpr -n cn.ndx
mv /dev/shm/tmp3.xtc TEMPORARY_FILES

echo "System" |  
/project/pomes/cneale/GPC/exe/intel/gromacs-4.5.3_modtrjconv/exec/bin/trjconv  
-box 6 6 14 -f /dev/shm/tmp4.xtc -o /dev/shm/tmp5.xtc -s centered.tpr  
-n cn.ndx
mv /dev/shm/tmp4.xtc TEMPORARY_FILES

echo "DOPC System" |  
/project/pomes/cneale/GPC/exe/intel/gromacs-4.5.3_modtrjconv/exec/bin/trjconv  
-center -pbc none -f /dev/shm/tmp5.xtc -o /dev/shm/tmp6.xtc -s  
centered.tpr -n cn.ndx
mv /dev/shm/tmp5.xtc TEMPORARY_FILES

echo "NE_CZ_NH1_NH2_CB_CG_CD System" |  
/project/pomes/cneale/GPC/exe/intel/gromacs-4.5.3_modtrjconv/exec/bin/trjconv  
-fit transxy -pbc none -f /dev/shm/tmp6.xtc -o /dev/shm/tmp7.xtc -s  
centered.tpr -n cn.ndx
mv /dev/shm/tmp6.xtc TEMPORARY_FILES

# Now center the solute at 0 0 0
echo "NE_CZ_NH1_NH2_CB_CG_CD" |  
/project/pomes/cneale/GPC/exe/intel/gromacs-4.5.3_modtrjconv/exec/bin/g_traj  
-f /dev/shm/tmp7.xtc -ox -s ../../useful/dry.tpr -n cn.ndx -com
avg=($(cat coord.xvg|grep -v '[@|#]' | awk '{x+=$2;y+=$3;z+=$4;n++}  
END{print -1*x/n,-1*y/n}'))
/project/pomes/cneale/GPC/exe/intel/gromacs-4.5.3_modtrjconv/exec/bin/trjconv  
-f /dev/shm/tmp7.xtc -o /dev/shm/tmp8.xtc -trans ${avg[0]} ${avg[1]} 0
mv /dev/shm/tmp7.xtc TEMPORARY_FILES


Chris.

-- original message --

> Hi,
>
>   I am trying to calculate the density profile of  head group of  
> bilayer normal to z direction using gromacs 4.0.7. I was trying to  
> center the density profile about dx/2.dy/2,0 . But, I am finding  
> problem with using center option. I find using -center option does  
> not shift the bilayer to 0. The following was my command-lines:
> g_density_4mpi -f ../traj_npt -s ../topol -noxvgr -n ../index -b  
> 600000 -dens number -center -o density_phosphate_symm.xvg
>
> Any help on how to use the center option will be really helpful.
>

For this purpose, trjconv is more reliable.

-Justin

-- 
========================================

Justin A. Lemkul
Ph.D. Candidate
ICTAS Doctoral Scholar
MILES-IGERT Trainee
Department of Biochemistry
Virginia Tech
Blacksburg, VA
jalemkul[at]vt.edu | (540) 231-9080
http://www.bevanlab.biochem.vt.edu/Pages/Personal/justin





More information about the gromacs.org_gmx-users mailing list