Re: [AMBER] Cpptraj to center molecules

From: Aseel Bala Ahmed <>
Date: Sat, 12 Aug 2017 15:55:32 -0400

However, would this center only molecule 4?
I am looking to center the entire hydrogen bonded cluster (i.e. molecules 4
and 5prime).

When I use: autoimage origin anchor :4,5
I get an error:
Error: Anchor mask [:4,5] corresponds to 2 mols, should only be 1.

Which tells me I could only use the command with one molecule.

Would a way around this be to use
autoimage origin anchor:4
center :4,5 origin

to first wrap and find images and then center the whole cluster?

Thanks very much for your help.

-----Original Message-----
From: Daniel Roe []
Sent: Saturday, August 12, 2017 1:50 PM
To: AMBER Mailing List <>
Subject: Re: [AMBER] Cpptraj to center molecules


On Fri, Aug 11, 2017 at 3:36 PM, Aseel Bala <> wrote:
> However, I am running into an issue when 4 is on one edge of the frame
> and 5 is on the other edge. In these situations, 4 is actually
> H-bonded to an 'image' of 5 produced by the periodic boundary
> condition. Let's call this image 5prime.

What you are describing is an imaging artifact, and is very common in MD
simulations with PBC and coordinate wrapping. The 'autoimage'
command was designed to handle this kind of situation. Instead of 'center'
and 'image', try:

autoimage origin anchor :4

Hope this helps,


PS - FYI the 'hbond' command in cpptraj now handles imaging natively via the
'image' keyword.

> In this case, cpptraj actually centers 4 and 5 instead of 4 and 5prime.
> Is there a way that cpptraj can be used to center a molecule and the
> closest image of another molecule to it? So that I would be able to
> have 4 and 5prime in the center?
> Thank you very much in advance!
> --
> Aseel M. Bala
> Michigan State University
> _______________________________________________
> AMBER mailing list
> mailman_listinfo_amber&d=DwICAg&c=nE__W8dFE-shTxStwXtp0A&r=-GD698Wi4V6
> QX_wrQuVQ3g&m=20LfRjbPT5pG45UMK4hwAELKL8JMnHCY6shlM8F3YMc&s=2VwOyV3A3d
> 5ORrRFvnH2briLHIegcR6PBQ-6H8Ep4cA&e=

Daniel R. Roe
Laboratory of Computational Biology
National Institutes of Health, NHLBI
5635 Fishers Ln, Rm T900
Rockville MD, 20852
AMBER mailing list
AMBER mailing list
Received on Sat Aug 12 2017 - 13:00:02 PDT
Custom Search