Re: [AMBER] Split a trajectory into frames

From: Daniel Roe <daniel.r.roe.gmail.com>
Date: Thu, 26 Jan 2017 10:09:47 -0500

Certain output formats (amber restart/netcdf restart, mol2, pdb)
support doing this automatically. For restart files this is the
default behavior. For PDB/Mol2 files you need to use the 'multi'
keyword with trajout.

On Thu, Jan 26, 2017 at 9:50 AM, Kenneth Huang
<kennethneltharion.gmail.com> wrote:
> I'd also be curious if there's a faster way that doesn't require reloading
> the trajectory every single time, though.

For formats that don't have an option for splitting into individual
files (like Amber ASCII trajectory etc), the solution is to have your
script create one input file and do it within the script (example in
bash):

lastframe=`cpptraj -p myparm.parm7 -y mytraj.nc -tl | awk '{print $2}'`
cat > cpptraj.in <<EOF
parm myparm.parm7
trajin mytraj.nc
EOF
for ((frame=1; frame <= $lastframe; frame++)) ; do
  echo "trajout snapshot.$frame.crd onlyframes $frame" >> cpptraj.in
done
cpptraj -i cpptraj.in

Hope this helps,

-Dan

-- 
-------------------------
Daniel R. Roe
Laboratory of Computational Biology
National Institutes of Health, NHLBI
5635 Fishers Ln, Rm T900
Rockville MD, 20852
https://www.lobos.nih.gov/lcb
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Thu Jan 26 2017 - 07:30:02 PST
Custom Search