Re: [AMBER] [cpptraj] Automating pcmin/pcmax selection of modes command

From: Daniel Roe <daniel.r.roe.gmail.com>
Date: Tue, 19 Apr 2016 09:49:31 -0600

On Tue, Apr 19, 2016 at 5:52 AM, Eiros Zamora, Juan
<j.eiros-zamora14.imperial.ac.uk> wrote:
> I’m trying to automate the selection of the pcmin/pcmax values of the ‘modes' command, to generate pseudo-trajectories along the PC’s of motion.I know that I can set them manually by looking at the histogram (actually gaussian kde, but I guess it’s the same) of the PC projection, but I’d like cpptraj to do that job.

Short answer: this can't be done yet directly. This would require that
argument lists in cpptraj have access to the master DataSetList, which
is not implemented and will be a bit tricky, even though it is on my
To-Do list.

However, you can get the behavior you want without too much trouble
via some scripting. Assuming you have your original PC projection data
(i.e. 'out' from 'projection') saved as 'project.dat', your eigenmodes
saved as 'tz2.modes.mwcovar.dat', and you used the mask '.CA' to
generate the original matrix, you could do something like (bash):

# Get min and max values
cat > proj.in <<EOF
readdata project.dat name Project
runanalysis avg Project:* out Avg.dat
EOF
cpptraj -i proj.in
# For each min and max value generate a 'modes trajout'
cat > proj.in <<EOF
parm tz2.parm7
readdata tz2.modes.mwcovar.dat name MyModes
EOF
M=1
while read LINE ; do
  if [[ `echo $LINE | awk '{print $1}'` != '#SetNum' ]] ; then
    MIN=`echo $LINE | awk '{print $4}'`
    MAX=`echo $LINE | awk '{print $5}'`
    echo "modes trajout $M.nc trajoutfmt netcdf name MyModes
trajoutmask .CA pcmin $MIN pcmax $MAX" >> proj.in
    ((M++))
  fi
done < Avg.dat
cpptraj -i proj.in

Some more comments are below.

> The file I’m loading into cpptraj looks like so:
>> $ head PC1_proj.dat
>> #Frame kde_00026 kde_00027 kde_00028
>> -261.602 0.0001 0.0000 0.0000
>
> But I’m failing to subset the 1D ‘Frame’ data, from which I want to extract the min and max values. Below are the commands that I’ve tried, with no success:
>> > proj[Frame]
>> Warning: Data set 'proj[Frame]' not found.

If you check your cpptraj input you'll see that by convention cpptraj
will typically not read in columns labeled '#Frame' as a separate data
set since it assumes they are X values corresponding to the Y values
in other columns (which indeed they are). This behavior can be turned
off in 'readdata' by specifying 'index -1' (no index column).

In general you can type 'list dataset' to see how your data sets are
named in cpptraj, and 'selectds' to test data set selection.

Hope this helps,

-Dan

>> Error: Data set with name 'proj[Frame]' not found.
>> 'proj[Frame]': Invalid command or expression.
>> > proj:1
>> Warning: Data set 'proj:1' not found.
>> Error: Data set with name 'proj:1' not found.
>> 'proj:1': Invalid command or expression.
>> > proj[kde_00026]
>> Warning: Data set 'proj[kde_00026]' not found.
>> Error: Data set with name 'proj[kde_00026]' not found.
>> 'proj[kde_00026]': Invalid command or expression.
>
> What am I doing wrong? Is what I am trying to accomplish not possible with cpptraj?
>
> Thanks for any help on this,
>
> Juan Eiros
> _______________________________________________
> AMBER mailing list
> AMBER.ambermd.org
> http://lists.ambermd.org/mailman/listinfo/amber



-- 
-------------------------
Daniel R. Roe, PhD
Department of Medicinal Chemistry
University of Utah
30 South 2000 East, Room 307
Salt Lake City, UT 84112-5820
http://home.chpc.utah.edu/~cheatham/
(801) 587-9652
(801) 585-6208 (Fax)
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Tue Apr 19 2016 - 09:00:03 PDT
Custom Search