Re: [AMBER] cpptraj: grid and gist

From: Daniel Roe <>
Date: Mon, 7 Dec 2015 08:39:02 -0700


The reason that OpenDX output from 'grid' and 'gist' do not match is
that the GIST code uses it's own internal logic when calculating and
writing out grids. The reason for this is when the GIST authors were
first incorporating the code into CPPTRAJ I was doing a major overhaul
of the the internal data set/data file framework, which wasn't ready
at the time. Since then making GIST use the data set/data file
framework has been on my to-do list (I feel like I say that a lot...).
As for whether there is a deeper reason for the difference I'm not
certain yet - I was not one of the primary authors of GIST so I'll
have to look into it further.

Thanks for the report!


On Mon, Dec 7, 2015 at 3:22 AM, Thomas Fox <> wrote:
> Hi,
> I think I stumbled over another inconsistency w.r.t. grid calculations.
> With the following cpptraj input:
> parm
> trajin
> parmbox 0. 0. 0.
> grid grid.dx 4 1. 4 1. 4 1. gridcenter 20. -2. 50. :WAT.O bincenter
> gist gridcntr 20. -2. 50. griddim 4 4 4 gridspacn 1. out gist.out
> I get two dx files for the water oxygen density, grid.dx (from the grid
> command) and gist-gO.dx (from the gist command)
> which I thought should produce a very similar output, as in both cases I
> calculate the same quantity.
> However, the dx headers read:
> grid.dx : origin 18.5 -3.5 48.5
> gist-gO.dx : origin 17.5 -4.5 47.5
> While the grid box definition is how I would expect it, the gist origin
> seems to be off by half a grid spacing.
> I would expect as x-values either 18,19,20,21,22 ( in case griddim refers to
> the number of grid bins - this is how I would
> understand the manual as it says "Integer number of grid increments along
> each coordinate axis")
> or 18.5., 19.5, 20.5, 21.5 (if grddim refers to the number of grid points in
> each direction which needs to
> shift by half a spacing to make up for the even number of points = uneven
> number of bins).
> Consequently, when I plot the two grids, first of all the grid boxes are
> shifted, but I also see differences in the grids;
> and more differences that I would have expected.
> For a single frame, this means that in some cases the two minima are on the
> same grid point, sometimes they
> are shifted into one direction in some cases in two directions by one grid
> point.
> For multiple frames the "structure" of the resulting grid maps looks very
> different - some of the contours (especially those
> with high occupancy) are in similar areas, but many of the contours appear
> at very different locations - is this to be expected?
> One more thing:
> In my above example, the trajectory has already been preprocessed, e.g.
> imaged and superposed. Yet, gist insists on getting
> box information, even if it is as useful as the command parmbox 0. 0. 0.
> Thanks for looking into this,
> Th.
> _______________________________________________
> 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 Mon Dec 07 2015 - 08:00:03 PST
Custom Search