Re: [AMBER] Howto cpptraj - multiple trajin-commands in one line

From: Chris Moth <cmoth08.gmail.com>
Date: Thu, 14 Jan 2016 09:40:23 -0600

Today, you need a shell script which create the .ptraj script. The ptraj
script may have 100s of lines of trajin commands. Such is life. Your
shell script will use your shell's "foreach" loop capability to read the
output from `echo ~/wherever/xxx_*.mdcrd | sort -nk whatever', and then
"echo trajin $filename >> ptrajfilename"

I have often thought that a "wildcard" input to trajin would be quite
convenient to avoid the need to create the .ptraj files from a script.
However, wildcards are not enough.. We'd also need to be able to tell
trajin to start a particular filename-number and stop at one.

On Thu, Jan 14, 2016 at 6:25 AM, Falko Jähnert <
falko.jaehnert.biochemtech.uni-halle.de> wrote:

> Dear AMBER-experts,
>
> I want to automatise my trajectory analysis. For that I use a bash script
> to read them in using:
>
> cpptraj prmtop <<EOF
> trajin xxx_1.mdcrd
> trajin xxx_2.mdcrd
> trajin xxx_3.mdcrd
> ##analysis commands##
> go
> EOF
>
> My filenames and my mdcrd counts differ a bit from run to run so I like to
> fill them in using variables. Filenames are not a problem, but the number
> of mdcrd files I would like to determine via checking if a
> filename-variable is setted. In this case I attach the trajin command for
> that file to an array.
>
> if [ -n "$xxx_1" ]; then
> Array+=('##necessary command##)
> fi
>
> Now I have the problem of using this array to call all the trajins.
> Is there a way in cpptraj to call multiple files with one trajin command?
> (i.e.: trajin xxx1.mdcrd xxx2.mdcrd xxx3.mdcrd)
> Alternative, is it possible to get those trajin commands in a single line?
> (i.e.: trajin xxx1.mdcrd; trajin xxx2.mdcrd; trajin xxx3.mdcrd)
>
> This will enforce the way I have to use for implementing the array filling
> function.
>
> Thanks in advance for your help! Hope, I didn't oversee these question in
> the Mailing Archive...
> Falko.
>
>
>
>
> _______________________________________________
> 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 Thu Jan 14 2016 - 08:00:03 PST
Custom Search