Re: [AMBER] Extract trajectories REMD

From: Daniel Roe via AMBER <>
Date: Thu, 16 Jun 2022 08:47:58 -0400


On Thu, Jun 16, 2022 at 6:36 AM Juliette Newell
<> wrote:
> Is there a way to modify this to loop over all temperatures and get a trajectory per temperature?
> The tutorial says:
> ptraj ala10.prmtop <<EOF
> trajin remd.mdcrd.001 remdtraj remdtrajtemp $T
> trajout remd.Ttraj.$T
> go

Which tutorial are you using? If it mentions ptraj it is probably
pretty old and out of date (and needs updating).

If you want to extract all of the temperature trajectories at once you
can use the 'ensemble' command. The 'ensemble' command is like 'trajin
remdtraj' but it sorts and processes all the replicas at once instead
of a single target replica. So you could do something like:

cpptraj <<EOF
parm ala10.prmtop
ensemble remd.mdcrd.001
rms R1 first .CA out ensemble.rmsd.dat

This will read in the ensemble of MD trajectories of which
remd.mdcrd.001 is the "lowest", sort by replica (temperature),
calculate the RMSD of each member of the sorted ensemble and output to
the file ensemble.rmsd.dat, and write out the sorted ensemble to<ext>, where <ext> will be a number corresponding to the
sorted ensemble (the corresponding temperature will be printed in the
output from cpptraj).

If the ensemble is large you can use the same input for cpptraj.MPI to
process the ensemble in parallel (using as many processes as
replicas). In parallel you can use to 'ensemblesize' command to
improve the efficiency of setup. So e.g. if you have a 12 member

mpirun -n 12 cpptraj.MPI <<EOF
parm ala10.prmtop
ensemblesize 12
ensemble remd.mdcrd.001
rms R1 first .CA out ensemble.rmsd.dat

Note that in parallel cpptraj will write each member to separate data
files, so you'll get ensemble.rmsd.dat.<ext>.

Hope this helps,


> Which I modified for my system. But this is what gave the error.
> Thank you,
> Juliette
> ________________________________
> From: Daniel Roe <>
> Sent: 15 June 2022 19:27
> To: Juliette Newell <>; AMBER Mailing List <>
> Subject: Re: [AMBER] Extract trajectories REMD
> Hi,
> On Wed, Jun 15, 2022 at 5:41 AM Juliette Newell via AMBER
> <> wrote:
> >
> > Hi Dan,
> >
> > Thank you for getting back to me.
> >
> > I have had a look at the cpptraj manual and also the replica exchange tutorial on the amber MD website and I am unsure where I am going wrong.
> >
> > The example in the manual says :
> >
> > trajin rem.001 remdtraj remdtrajtemp 300
> >
> > will this loop over all replicas? Or will I have to change the temperature at the end.
> As I said in my earlier response, you specify the "lowest" replica
> trajectory, and cpptraj automatically searches for the remaining
> trajectories based on extension. So for example if you have 4
> temperature REMD trajectories named,,
>, and you want to process frames at a target
> temperature of 330 K, you would use:
> trajin remdtraj remdtrajtemp 330
> Any actions or 'trajout' commands will then only be given the frames
> at 330 K. Does that make sense?
> -Dan

AMBER mailing list
Received on Thu Aug 04 2022 - 13:31:32 PDT
Custom Search