You can use tcl script in VMD.
You may want to modify the following tcl script.
Enjoy it.
+++++++++++++++++++++++++++++++++++++++
set outfile [open cn-m2-vmd.dat w]
set nf [molinfo top get numframes]
set g34 [atomselect top "resname GLY and name CA"]
set v27 [atomselect top "resid 7 34 61 88 and name CA"]
set c5 [atomselect top "resname HMT and name C5"]
set n1 [atomselect top "resname HMT and name N1"]
set all [atomselect top all]
set conv [expr 180.0/acos(-1.0)]
# angle calculation loop
for { set i 0 } { $i < $nf } { incr i } {
$g34 frame $i
$v27 frame $i
set com1 [measure center $g34]
set com2 [measure center $v27]
set m2 [vecsub $com2 $com1]
set m2mag [veclength $m2]
$c5 frame $i
$n1 frame $i
set com3 [measure center $c5]
set com4 [measure center $n1]
set cn [vecsub $com4 $com3]
set cnmag [veclength $cn]
set dotp [vecdot $m2 $cn]
set theta [expr $conv * acos($dotp / ($m2mag * $cnmag))]
if { $theta > 90.0 } {
set theta [expr 180.0 - $theta]
}
puts $outfile "[expr ($i + 1) * 10] $theta"
}
close $outfile
++++++++++++++++++++++++++++++++++++++++++
On 10/12/06, David A. Case <case.scripps.edu> wrote:
> On Thu, Oct 12, 2006, Lwin, ThuZar wrote:
>
> > Do you have any suggestion on how to do the following using amber
> > ptraj?
> > Vector 1: Assign a vector between atom A and B.
> > Vector 2: Assign another vector between atom C and D.
> > Then calculate angle between vector 1 and vector 2.
>
> My best guess is to use the vector command to write out files with the two
> vectors as a function of time, then use a short awk or perl script to compute
> the angles.
>
> (This would be a good functionality to have inside ptraj, but as far as I
> know, it is not there now.)
>
> ...dac
>
> -----------------------------------------------------------------------
> The AMBER Mail Reflector
> To post, send mail to amber.scripps.edu
> To unsubscribe, send "unsubscribe amber" to majordomo.scripps.edu
>
--
Best wishes,
MYUNGGI YI
==================================
KLB 419
Institute of Molecular Biophysics
Florida State University
Tallahassee, FL 32306
Office: (850) 645-1334
http://www.scs.fsu.edu/~myunggi
-----------------------------------------------------------------------
The AMBER Mail Reflector
To post, send mail to amber.scripps.edu
To unsubscribe, send "unsubscribe amber" to majordomo.scripps.edu
Received on Wed Oct 18 2006 - 06:07:17 PDT