Re: [AMBER] 3D Histogram in cpptraj

From: Daniel Roe <>
Date: Fri, 31 Oct 2014 10:53:42 -0600


What you want to do is not straightforward (as you have seen), but
with a little creative scripting I think it could be done. The way
that I would do it is as follows:

1) Generate data for the 3 dihedrals in each molecule, writing each to
a separate file. Use the 'noheader' keyword so the data file header is
not written.

2) Concatenate all of those files.

3) Read the concatenated data into cpptraj and histogram.

So the final scripts could be something like this:

Step 1 (cpptraj input):
parm myparm.parm7
dihedral m1-phi1 :20.C8 :20.C14 :20.C15 :20.C16 out m1.dat noheader
dihedral m1-phi2 :20.C8 :20.C14 :20.C15 :20.C16 out m1.dat noheader
dihedral m1-phi3 :20.C14 :20.C15 :20.C16 :20.C17 out m1.dat noheader
dihedral m300-phi1 <mask1> <mask2> <mask3> <mask4> out m300.dat noheader
dihedral m300-phi2 <mask1> <mask2> <mask3> <mask4> out m300.dat noheader
dihedral m300-phi3 <mask1> <mask2> <mask3> <mask4> out m300.dat noheader

Step 2:
cat m1.dat m2.dat m3.dat ... m300.dat > AllMols.dat

Step 3 (cpptraj input):
# 'index 1' tells cpptraj that X values are in column 1
readdata AllMols.dat index 1
hist AllMols.dat:2 AllMols.dat:3 AllMols.dat:4 min -180 max 180 bins
72 out histnew.dx

Hope this helps,


On Thu, Oct 30, 2014 at 11:18 AM, CHAMI F. <> wrote:
> Dear all,
> I would like to do a 3D histogram of three consecutive dihedrals of a molecule in a box containing 300 molecules all identical
> dihedral phi1 :20.C8 :20.C14 :20.C15 :20.C16 out dihenew.dat
> dihedral phi2 :20.C8 :20.C14 :20.C15 :20.C16 out dihenew.dat
> dihedral phi3 :20.C14 :20.C15 :20.C16 :20.C17 out dihenew.dat
> hist phi3 phi4 phi5 min -180 max 180 bins 72 out histnew.gnu
> I would like to keep the same DataSet in order to accumulate data from all 300 molecules ..but
> cpptraj does not allow it
> Warning: DataSet 'phi3' already present.
> Error: Could not initialize action [dihedral]
> any help
> thanks
> Fatima
> _______________________________________________
> AMBER mailing list

Daniel R. Roe, PhD
Department of Medicinal Chemistry
University of Utah
30 South 2000 East, Room 307
Salt Lake City, UT 84112-5820
(801) 587-9652
(801) 585-6208 (Fax)
AMBER mailing list
Received on Fri Oct 31 2014 - 10:00:02 PDT
Custom Search