[AMBER] Cpptraj for loops and dataset operations

From: Pietro ARONICA via AMBER <amber.ambermd.org>
Date: Fri, 25 Nov 2022 06:13:00 +0000

Dear all,
I am having a hard time understanding how to use datasets and for loops work in cpptraj.
I have a pdb named file.pdb. I can calculate using the nativecontacts command all residues in mask1 that are within 6 A of mask2 with a command like this:

nativecontacts :mask1 :mask2 distance 6 resout res.dat

The first column of res.dat contains the residue numbers I am interested in. I have read in this file with

readdata res.dat name resi

What I would like to do at this point is calculate dihedrals of residues that are match the distance criteria I set before, ie those in the first column of res.dat. It is my understanding that resi:1 contains these data points but I do not understand how to extract them or use them.
In my mind, the for loop would look a little bit like this:

for i in resi:1
      dihedral :($i-1)@C :$i.N :$i.CA :$i.C out dihe_$i.dat
done

It would loop over the elements of the data set, using that number for the mask of the dihedral I want to calculate. I would also want to do some operations on the values.
However, I am unable to use the dataset in any way like that. If I just use the data set on the command line, it gives this:

> resi:1
  [resi:1]
    Result: 0.000000

which I am unsure how to interpret. I know the data is somewhere within that dataset because if I use writedata it will produce a text file with all the data points as I expect them.
Can anyone explain to me how data sets are used and accessed and possibly used in for loops?
Kind regards
Pietro Aronica
This e-mail and any attachments are only for the use of the intended recipient and may contain material that is confidential, privileged and/or protected by the Official Secrets Act. If you are not the intended recipient, please delete it or notify the sender immediately. Please do not copy or use it for any purpose or disclose the contents to any other person.
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Thu Nov 24 2022 - 22:30:03 PST
Custom Search