Re: [AMBER] Multiple trajectory analysis with CPPTRAJ and getting output for each of them separately

From: Daniel Roe <daniel.r.roe.gmail.com>
Date: Mon, 20 Aug 2018 14:07:24 -0400

Hi,

If all the trajectories are the same length you can use "ensemble"
mode to process each trajectory at the same time; just replace
'trajin' with 'ensemble'. This can also be done in parallel via MPI
using 1 or more processes per trajectory.

If they are different lengths, the easiest way to do things right now
is construct the input file via a loop in a bash script; the only
trick is to do something like 'clear trajin' in between each 'run'.
Also, if you have any commands that generate named data sets you'll
want to make sure you choose different names each time - if you aren't
specifically naming output data sets there should be no issue. For
example:

#!/bin/bash
echo 'parm myparm.parm7' > cpptraj.in
i=1
for FILE in protein1.nc protein2.nc ... proteinN.nc ; do
  cat >> cpptraj.in <<EOF
trajin $FILE
# Note that this will write the stripped parm multiple times; inefficient
# but should be ok.
strip :1-2,4-100,NA,CL,WAT outprefix STRIP
autoimage
<anything that cpptraj does or can do>
trajout strip.protein.$i.nc
run
clear trajin
EOF
  ((i++))
done

Disclaimer: I haven't tested the above script exactly, but that or
something like that should do what you want.

Hope this helps,

-Dan


On Thu, Aug 16, 2018 at 3:12 AM Luka Bilić <Luka.Bilic.irb.hr> wrote:
>
> Dear AMBER community,
>
> I'm wondering is there an elegant way of loading an N number of
> trajectories in cpptraj and getting an output of analysis for each of
> them?
>
> If I load N of them I get results of a combined length trajectory. I
> don't want that now.
>
> I could hypothetically cut the results at the "right spot" in order to
> correspond to the trajectory 1 or 2 or N. But then again I could also
> run the N number of scripts for cpptraj and get them anyway. A tedious
> job I would like to avoid.
>
> But how about loading multiple of trajectories and getting multiple
> (corresponding) outputs?
> How could I do that in cpptraj script:
>
> parm protein.parm7
> trajin protein1.nc
> trajin protein2.nc
> ...
> trajin proteinN.nc
> strip 1-2,4-100,NA,CL,WAT outprefix STRIP
> autoimage
> <anything that cpptraj does or can do>
> trajout ? #for the corresponding trajectory N"
> # N number of outputs each for the corresponding trajecotry N"
>
> Thank you for the help.
> In the meanwhile I will try to search for the solution for this.
> Worst case scenario: a little bit of bash scripting and some input
> copy-paste-modify :)
>
> Yours,
> Luka
>
> _______________________________________________
> AMBER mailing list
> 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 Mon Aug 20 2018 - 11:30:03 PDT
Custom Search