Re: [AMBER] Shifting molecules by a box length

From: Jason Swails <>
Date: Wed, 9 Oct 2013 11:06:46 -0400

On Wed, Oct 9, 2013 at 10:53 AM, Heribert Reis <> wrote:

> Hello,
> >From a colleague I got the cartesian coordinates of a snapshot from a
> AMBER-MD run of a protein molecule surrounded by water, which I would like
> to use now in a different program. I just need the protein molecule, fully
> surrounded by a layer of water. In the snapshot the protein molecule is not
> fully inside the unit cell (sticking out in z-direction), so I need to
> shift some of the water molecules by one box length, but however I do that,
> I end up with much too short distances between some of the shifted water
> molecules and atoms of the protein.
> The unit cell is a truncated octahedron, the triclinic cell length is about
> 97 Ang (in all 3 directions), so according to some previous messages in
> this list, I multiply this by sqrt(3)/2 to get the cubic box length of ~112
> Ang (which is also about the max distance between the water molecules in
> z-direction, so that seems to be about correct), but just adding this
> number to the z-coordinates of the waters I end up with those very short
> distances, so I guess that is not the correct procedure. What would be the
> correct way to do it?

You can use cpptraj to image the water into a periodic cell centered on
your solute. The following cpptraj script should do what you want it to do:

parm <your_prmtop>
trajin <your_trajectory>
trajout <imaged_trajectory>

<your_trajectory> can be any of a number of formats (NetCDF trajectory,
ASCII trajectory, PDB, etc.). <your_prmtop> can be an Amber topology
file or PDB file. The imaged_trajectory can be written as a PDB file
(.pdb), NetCDF trajectory (.nc) or normal ASCII trajectory file (.mdcrd)
based on the extension of the file name (or it can be explicitly set in the
trajout command).

cpptraj is then run like:

cpptraj -i <script_file>

This is all detailed in the AmberTools manual.


Jason M. Swails
Rutgers University
Postdoctoral Researcher
AMBER mailing list
Received on Wed Oct 09 2013 - 08:30:08 PDT
Custom Search