Re: [AMBER] how to calculate the mass center distance between adjacent repeat units of one polymer chain

From: Wesley Michael Botello-Smith <>
Date: Tue, 5 Jun 2018 10:13:23 -0700

I would use pytraj to this. You can accomplish the same thing using the "" command
That way you have access to python syntax and you can run your loop in

You could even then use pytraj.compute or pytraj.pmap if you want to do the
loop for you. These commands can take a python style list of individual
commands as input and will automatically run each one. The pmap command
will even let you run them in parallel.

If you really want to do this in cpptraj, you would have to write each i j
combination explicitly. Before I learned pytraj, I would usually write a
bash script to generate the cpptraj input script to do that sort of

Hope that helps!

On Tue, Jun 5, 2018 at 9:53 AM, 唐元晖 <> wrote:

> Hello all,
> This is Yuanhui. I want to calculate the distance between two residues as
> :i and :j, and i, j can be changed during a loop. However, the distance
> mask doesn't recognize the word :i. The input file is written like this:
> parm *.prmtop
> trajin md15.mdcrd 1 last 200
> i=2
> j=3
> distance dist :i :j out dist.dat
> Is there a way can make the cpptraj recognize the variable 'i' and 'j',
> because I want to change their values.
> Best wishes!
> --
> Dr. Yuanhui Tang
> Ralph E. Martin Department of Chemical Engineering
> University of Arkansas
> Cato Springs Research Center
> Fayetteville, AR 72701
> email:
> voice: (479) 409-9989
> _______________________________________________
> AMBER mailing list
AMBER mailing list
Received on Tue Jun 05 2018 - 10:30:02 PDT
Custom Search