VMD-L Mailing List
From: John Stone (johns_at_ks.uiuc.edu)
Date: Fri Jun 20 2003 - 10:03:15 CDT
- Next message: caldwell_at_heimdal.compchem.ucsf.edu: "Re: coloring waters"
- Previous message: John Stone: "Re: Bond Lengths"
- In reply to: Jan Saam: "coloring method: user"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Jan,
Here's a very simple example script that demonstrates how one can
set and then use the 'user' color field in VMD 1.8.1 (this script
just makes the example molecule throb, nothing fancy..):
##
## 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/h2/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 user $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 User
mol colupdate 0 0 1
mol scaleminmax 0 0 0.0 $numframes
animate forward
On Fri, Jun 20, 2003 at 01:56:26PM +0200, Jan Saam wrote:
> Hi John et al.,
>
> Could you please tell me how to use the new "user" coloring method, eg.
> how to set the user data?
>
> Cheers,
>
> Jan
-- NIH Resource for Macromolecular Modeling and Bioinformatics Beckman Institute for Advanced Science and Technology University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801 Email: johns_at_ks.uiuc.edu Phone: 217-244-3349 WWW: http://www.ks.uiuc.edu/~johns/ Fax: 217-244-6078
- Next message: caldwell_at_heimdal.compchem.ucsf.edu: "Re: coloring waters"
- Previous message: John Stone: "Re: Bond Lengths"
- In reply to: Jan Saam: "coloring method: user"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]