11.07.2015 Views

VMD User's Guide

VMD User's Guide

VMD User's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Applying this to the alanin.pdb coordinate filevmd > mol new alanin.pdbvmd > set sel [atomselect top all]vmd > gyr_radius $selInfo) 5.45443Root mean square deviation Compute the rms difference of a selection between two framesof a trajectory. This takes a selection and the values of the two frames to compare.proc frame_rmsd {selection frame1 frame2} {set mol [$selection molindex]# check the rangeset num [molinfo $mol get numframes]if {$frame1 < 0 || $frame1 >= $num || $frame2 < 0 || $frame2 >= $num} {error "frame_rmsd: frame number out of range"}# get the first coordinate setset sel1 [atomselect $mol [$selection text] frame $frame1]set coords1 [$sel1 get {x y z}]# get the second coordinate setset sel2 [atomselect $mol [$selection text] frame $frame2]set coords2 [$sel2 get {x y z}]# and compute the rmsd valuesset rmsd 0foreach coord1 $coords1 coord2 $coords2 {set rmsd [expr $rmsd + [veclength2 [vecsub $coord2 $coord1]]]}# divide by the number of atoms and return the resultreturn [expr $rmsd / ([$selection num] + 0.0)]}The following uses the frame rmsd function to list the rmsd of the molecule over the wholetrajectory, as compared to the first frame.vmd > mol new alanin.psfvmd > mol addfile alanin.dcdvmd > set sel [atomselect top all]vmd > for {set i 0} {$i < [molinfo top get numframes]} {incr i} {? puts [list $i [frame_rmsd $sel $i 0]]? }0 0.01 0.1000782 0.2914053 0.523673....97 20.009598 21.049599 21.5747163

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!