## ## Example script that sets the "User" data field with time varying values ## which can be used to color over time ## ## ## load a fake "trajectory" by repeatedly loading the same PDB :-) ## set file /home/johns/vmd/proteins/brH.pdb if {[molinfo num] > 0} { mol delete all } mol new $file for {set i 0} {$i<20} {incr i} { mol addfile $file } ## ## Make an atom selection, set the "User" fields for all atoms ## in the selection ("all" in this case since I'm too lazy to do ## something more interesting) ## set numframes [molinfo top get numframes] set sel [atomselect top "all"] for {set i 0} {$i<$numframes} {incr i} { animate goto $i $sel frame $i puts "Setting User data for frame [$sel frame] ..." $sel set user2 $i } $sel delete ## ## change the "color by" and "trajectory" tab settings so that ## the new color values, and start it animating... ## mol modcolor 0 0 User2 mol colupdate 0 0 1 mol scaleminmax 0 0 0.0 $numframes animate forward