Re: [AMBER] Generating snapshots in amber trajectory format

From: Jason Swails <jason.swails.gmail.com>
Date: Thu, 1 Aug 2013 09:42:32 -0400

On Thu, Aug 1, 2013 at 6:48 AM, aneesh cna <aneeshcna.gmail.com> wrote:

> Dear Amber users,
>
> I am trying to use PTRAJ for generating number of snapshots in Amber
> trajectory format (ie. *.crdbox format) from my 5ns long trajectory file,
> which contains 2500 frames. Below is the script I used for the same.
>
> ***********************************
> trajin ../../md1.crd 1 2500 25
>
> strip :WAT,:Na+
>
> center :1-293 mass origin
> image origin center
>
>
> trajout crd_snap trajectory
> ************************************
>
> Unfortunately, PTRAJ outputted all the snapshots in a single file with
> *.crdbox format, rather than generating individual file of each snapshot.
> But, if I change the output format in the script to PDB, I can able get the
> snapshots in separate files with PDB format.
>

You need to write a separate ptraj script for each frame. Very rarely do
people want to write multiple, single-frame trajectory format files.

I've never seen an instance where I needed separate mdcrd-formatted files,
but if you really need that, you will have to write a separate script for
each frame you want.

The following is a simple example script that should do what you want
(untested):

#!/bin/sh

for frame in `seq 1 25 2500`; do
ptraj my_prmtop << EOF
trajin ../../md1.crd $frame $frame

strip :WAT,Na+

center :1-293 mass origin
image origin center

trajout crd_snap.crdbox.$frame
EOF
done

Good luck,
Jason

-- 
Jason M. Swails
BioMaPS,
Rutgers University
Postdoctoral Researcher
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Thu Aug 01 2013 - 07:00:03 PDT
Custom Search