From: John Stone (johns_at_ks.uiuc.edu)
Date: Wed Jun 22 2005 - 14:19:38 CDT

Dow,
  One complex but potential solution to your problem is to use the
Beta or User data fields in VMD to custom-color your structure.
In order to use this method to assign specific colors, you'll need to
use a script like the example in the User's Guide to assign specific
RGB colors to specific color scale values.
Then, you'll need to set the color scale data range to 0 to 1023.
Once you've done that, then whatever beta/user value you assign to
an atom will correspond directly to the color you want.
Using this somewhat laborius method, you have 1024 colors you can
assign any way you like. This will also affect any other
reps that use color scales, so it's still not an ideal solution, but
you may find that it works for the specific visualization you're doing.

proc setcolorscaleindex { index r g b } {
  set colorindex [expr [colorinfo num] + $index]
  color change rgb $colorindex $r $g $b
}

setcolorscaleindex 0 1 1 1
setcolorscaleindex 1 1 0 0
setcolorscaleindex 2 0 1 0
setcolorscaleindex 3 0 0 1
setcolorscaleindex 4 0 1 1
setcolorscaleindex 5 1 0 1
setcolorscaleindex 6 1 1 0

set sel [atomselect top all]
$sel set beta 0.0
$sel delete

set sel [atomselect top "name CA"]
$sel set beta 1.0
$sel delete

mol modcolor 0 0 Beta

## note that the 'mol scaleminmax' command has to be last...
mol scaleminmax 0 0 0 1023

  John Stone
  vmd_at_ks.uiuc.edu

On Tue, Jun 21, 2005 at 05:19:49PM -0400, Dow Hurst DPHURST wrote:
> Along this note of using multiple graphical representations:
>
> I've been using this where possible, but I've found that bonds aren't drawn
> between atoms within a residue unless they are specified within the same
> graphical representation. VdW display will work with this method nicely
> since the spheres overlap and hide the fact that the atoms aren't bonded.
> The Licorice display, which is the nicest for protein residues, is where
> I've wished most for more than two color categories to work with, where
> atoms have assignable colors based on element. Is there a way to force
> bonding of atoms within a residue when the atoms are not specified in the
> same graphical representation? That would solve this particular problem.
>
> For example:
> resid 22 and chain G and (not name N HN HA C O) and (not name 1HB 2HB HD1
> HD2 HE1 HE2)
> gives a nice stripped down look for a TYR when displayed in Licorice. The
> O-H is displayed but no other hydrogens. Coloring by color ID to green
> would be fine.
> To color the OH so the O is red and the H is white might could be done
> with:
> resid 22 and chain G and name OH
> and coloring with color ID to red
> resid 22 and chain G and name HH
> and coloring with color ID to white.
>
> The problem is the atoms OH and HH show up as spheres in Licorice mode that
> aren't connected to each other or the rest of the TYR. I've messed around
> with bond radius and sphere radius but losing the split bond look ends up
> less attractive.
> Thanks,
> Dow
>
>
> __________________________________
> Dow P. Hurst, Research Scientist
> Department of Chemistry and Biochemistry
> University of North Carolina at Greensboro
> 435 New Science Bldg.
> Greensboro, NC 27402-6170
> dphurst_at_uncg.edu
> Dow.Hurst_at_mindspring.com
> 770-241-2015 cell
> 336-335-4766 lab
> 336-334-5122 office
> 336-334-5402 fax

-- 
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