Re: [AMBER] trajout last x frames cpptraj

From: Hughes, Travis <travis.hughes.mso.umt.edu>
Date: Fri, 29 Sep 2017 14:34:35 +0000

Hai, thanks, this gives us another option if nothing exists in cpptraj.

Travis Hughes
Assistant Professor
Biomedical and Pharmaceutical Sci.
Center for Biomolecular Structure and Dynamics
University of Montana, Missoula
travis.hughes.umontana.edu<mailto:travis.hughes.umontana.edu>
(406) 243-2750









On Sep 28, 2017, at 9:28 PM, Hai Nguyen <nhai.qn.gmail.com<mailto:nhai.qn.gmail.com>> wrote:

On Thu, Sep 28, 2017 at 11:27 PM, Hai Nguyen <nhai.qn.gmail.com<mailto:nhai.qn.gmail.com>> wrote:



On Thu, Sep 28, 2017 at 2:23 PM, Hughes, Travis <travis.hughes.mso.umt.edu<mailto:travis.hughes.mso.umt.edu>
wrote:

Is there any built in way (without knowing how many frames are in a
trajectory) to trajout only the last say 500 frames of a trajectory?
for example something like this:

trajin sometraj.nc 1 last 1
trajout sometrajlast500.nc -500 last 1


We can script something to find the length of the trajectory and then use
that info to do this, but is there something easy and built in to cpptraj?


hi,

Just an alternative solution (while waiting for cpptraj reply): with
pytraj (Python binding to cpptraj), you can have fancy indexing like that
http://amber-md.github.io/pytraj/latest/trajectory_
exercise.html#fancy-indexing

traj[:-500].save("some.nc")


uhm, should be traj[-500:].save("some.nc")
(which is similar to python list fancy indexing).

Hai


Hai

Thanks,
Travis


Travis Hughes
Assistant Professor
Biomedical and Pharmaceutical Sci.
Center for Biomolecular Structure and Dynamics
University of Montana, Missoula
travis.hughes.umontana.edu<mailto:travis.hughes.umontana.edu><mailto:travis.hughes.umontana.edu>
(406) 243-2750










_______________________________________________
AMBER mailing list
AMBER.ambermd.org<mailto:AMBER.ambermd.org>
http://lists.ambermd.org/mailman/listinfo/amber



_______________________________________________
AMBER mailing list
AMBER.ambermd.org<mailto:AMBER.ambermd.org>
http://lists.ambermd.org/mailman/listinfo/amber


_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Fri Sep 29 2017 - 08:00:02 PDT
Custom Search