From: John Stone (johns_at_ks.uiuc.edu)
Date: Tue Mar 14 2006 - 00:39:40 CST

Jeff,
  The example you cite was simply colored by atom name. Because surf
doesn't assign atom IDs to each vertex in the surface, whole facets are
colored by atom properties, which results in a fairly coarse coloring
of the surface. You can do this sort of thing quite easily though, like
this (say you had 100 atoms for example):
  set sel1 [atomselect top "index 0 to 50"]
  set sel2 [atomselect top "index 51 to 99"]
  $sel1 set beta 1.0
  $sel2 set beta 2.0
  $sel1 delete
  $sel2 delete

You could just as easily have made the selections something else:
  set sel1 [atomselect top "x > 0"]
  set sel2 [atomselect top "x < 0"]

Then set the rep coloring mode to "beta" and use the color scale
data range and color scale controls to tweak if necessary.
Do you need more of an example than this or does this make it clear?

  John Stone
  vmd_at_ks.uiuc.edu

On Mon, Mar 13, 2006 at 02:12:09PM -0600, Jeffrey Tseng wrote:
> Hi, John
> Thanks for your quick responding and helpful comments.
>
> Yes, you are right. If I split the selection into parts. The
> reprensentation is not what I want.
>
>
> I would like to try the other way that you suggest, which is to use per-atom
> data fields such as "user" or "occupancy".
>
> Could you please use my example I gave in the previous email to show how to
> color different selections of the same repesentation?
>
>
>
>
>
> Also, I found that in KS website, there is one example. It looks like a
> perfect example.
> Here is link.
> http://www.ks.uiuc.edu/Research/vmd/allversions/repimages/surf.jpg
> If you know how to generate it, I wonder if the vmd script is available.
>
> Thanks a lot,
>
> -Jeffrey
>
>
>
>
>
>
>
>
> On 3/13/06, John Stone <johns_at_ks.uiuc.edu> wrote:
> >
> >
> > Hi,
> > A representation can only have one coloring method active at a time.
> > If you use the ColorID coloring method, then that eliminates the
> > possibility
> > of having two colors at once for a given selection. You could either
> > split
> > your atom selection into two parts and make one representation for each,
> > coloring them differently (which may not work very well for your Surf
> > representation), or you can assign values to one of the per-atom
> > data fields such as "user", "beta", "occupancy", etc, and then color
> > by that data field rather than by ColorID. Let me know if you need
> > more help with this.
> >
> > John Stone
> > vmd_at_ks.uiuc.edu
> >
> > On Sun, Mar 12, 2006 at 02:52:15PM -0600, Jeffrey Tseng wrote:
> > > Hi,
> > >
> > > Is it possible to change the color of subset of the selection ?
> > >
> > > Here is an example:
> > > ###########################
> > > mol representation SURF 1.4
> > > atomselect macro myselect {
> > > resname ASN and resid 273 and name OD1
> > > or resname ASP and resid 269 and name OD2
> > > or resname ASP and resid 269 and name OD1
> > > or resname ASP and resid 269 and name CG
> > > or resname HIS and resid 268 and name NE2
> > > or resname LEU and resid 210 and name CD1
> > > or resname LEU and resid 210 and name CG
> > > or resname LEU and resid 210 and name CB
> > > or resname LEU and resid 210 and name N
> > > }
> > >
> > > mol selection {myselect}
> > > mol color colorID 12
> > > mol addrep top
> > >
> > > ########################################
> > >
> > > Now myselect will be colored "green" surface.
> > >
> > >
> > > Here is the subselction
> > >
> > > mol selection {
> > > resname ASN and resid 273 and name OD1
> > > or resname ASP and resid 269 and name OD2
> > > or resname ASP and resid 269 and name OD1
> > > or resname ASP and resid 269 and name CG
> > > }
> > >
> > >
> > > I would like to make the subselection colored "red" and the surface
> > > representation can not be changed.
> > >
> > > Is there any good way to make this task happen ?
> > >
> > >
> > > Thanks in advance.
> > >
> > > -Jeffrey
> >
> > --
> > 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
> >

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