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.

proc total_mass1 {selection} {set mass [$selection get mass]eval "vecadd $mass"}Coordinate min and max Find the min and max coordinate values of a given molecule in thex, y, and z directions (see also the measure command ’minmax’). The function takes the moleculeid and returns two vectors; the first contains the min values and the second contains the max.proc minmax {molid} {set sel [atomselect top all]set sx [$sel get x]set sy [$sel get y]set sz [$sel get z]set minx [lindex $sx 0]set miny [lindex $sy 0]set minz [lindex $sz 0]set maxx $minxset maxy $minyset maxz $minzforeach x $sx y $sy z $sz {if {$x < $minx} {set minx $x} else {if {$x > $maxx} {set maxx $x}}if {$y < $miny} {set miny $y} else {if {$y > $maxy} {set maxy $y}}if {$z < $minz} {set minz $z} else {if {$z > $maxz} {set maxz $z}}}return [list [list $minx $miny $minz] [list $maxx $maxy $maxz]]}Radius of gyration Compute the radius of gyration for a selection (see also measure rgyr). Thesquare of the radius of gyration is defined as ∑ i m i(⃗r i − ⃗r c ) 2 / ∑ i m i.Thisusesthecenterof massfunction defined earlier in this chapter; a faster version would replace that with measure center.Note that the measure rgyr command does the same thing as this script, only much much faster.proc gyr_radius {sel} {# make sure this is a proper selection and has atomsif {[$sel num]

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

Saved successfully!

Ooh no, something went wrong!