How to calculate pair distance, angles and dihedrals

From Computational Biophysics and Materials Science Group
Jump to: navigation, search
 set molnum [mol new ../../ionized.pdb type pdb waitfor all]
    mol addfile NPT-07.dcd type dcd step 100 waitfor all
    mol addfile NPT-08.dcd type dcd step 100 waitfor all
    mol addfile NPT-09.dcd type dcd step 100 waitfor all

 set num_frames [molinfo $molnum get numframes]

 set a [atomselect top "segname  P1 and resid 204 and name CA"]
 set c [atomselect top "segname  P2 and resid 212 and name CA" ]
 set b [atomselect top "segname  P1 and resid 212 and name CA"]
 set d [atomselect top "segname  P2 and resid 204 and name CA" ]

 set outfile [open "local-dis-204-212-mar23-cse.dat" w]

 for {set i 0} {$i<$num_frames} {incr i} {
 $a frame $i
 $b frame $i
 $c frame $i
 $d frame $i

 set C1 [measure center $a]
 set C2 [measure center $c]
 set C3 [measure center $b]
 set C4 [measure center $d]


 set dis1 [ veclength [vecsub $C1 $C2] ]
 set dis2 [ veclength [vecsub $C3 $C4] ]

 puts $outfile "$i  \t$dis1  \t$dis2  "

 }

 close $outfile