[Chimera-users] labeling residues

Daniel Gurnon danielgurnon at depauw.edu
Mon May 16 10:49:12 PDT 2011

Elaine, this is very close to what I'm looking for (I hadn't heard of "shape
tube", but its perfect for what I want to do).

As I understand it, if the script is to work with any pdb structure, I will
need two segments of python code:

1) custom residue labeling to display only 1-letter code and number, and
2) something that creates a separate tube for each chain in a model, without
connecting one tube to the next.

I would love to wrap this into a button (e.g.,
a student could push once he or she has loaded a structure. If its easy to
do and someone else could give me the python snippet for 1) and 2) above,
that would be great.

Thanks as always for the help.

On Mon, May 16, 2011 at 12:55 PM, Elaine Meng <meng at cgl.ucsf.edu> wrote:

> Hi Dan,
> You'd probably also want to undisplay atoms/bonds, so something like
> ~disp; ribbon; ribsc licorice
> (A) label positioning.  You could either use residue labels with "primary
> atom" positioning or atom labels at CA showing residue info, i.e. :
> rlabel; setattr m residueLabelPos 2
> - OR -
> disp @ca; labelopt info residue; la @ca
> (the balloon help on the attributes panel gives the attribute name and its
> allowed values for use with "setattr," and "m" indicates it is an attribute
> of molecule models). Even though you might expect "centroid" residue label
> positioning to be the same as "primary atom" when only the CA is displayed,
> it is different because the latter includes an offset.
> (B) custom label content.  I don't think it can be done with Chimera
> commands, but the Chimera command file could open a python snippet.
>  Somebody else would need to give the exact code for what you describe, but
> this previous message gives something similar for custom residue labeling:
> <
> http://plato.cgl.ucsf.edu/pipermail/chimera-users/2010-October/005622.html
> >
> (C) color ribbon near CA.  I believe you can only color the segment
> representing the whole residue.  I don't think there is any way to color a
> shorter segment of ribbon than that.  An alternative, however, is to abandon
> ribbons entirely and make a tubular surface that follows the path of the
> backbone instead.  This allows coloring a narrow band of tube and has the
> added advantage of following the true locations of the atoms instead of
> making a smooth interpolation like the ribbon.  More details here:
> <
> http://www.cgl.ucsf.edu/chimera/docs/ContributedSoftware/ribbonstyle/ribbonstyle.html#offset
> >
> ... but briefly, something like:
> ~ribbon; rainbow
> shape tube :.a at ca radius 0.35 bandLength 2 modelId 1
> ... where I just used rainbow to color the invisible alpha-carbons so you
> can see the colored bands on the resulting tube.  The above only makes a
> tube for chain a (:.a).  If there are multiple chains, you'd want to do them
> separately, or else the tube would connect the end of one to the beginning
> of the next.  modelId is the model number for the resulting output surface.
> To label alpha-carbons, you would need to display them along with the tube
> but turn off auto-chaining so that Chimera won't draw straight lines between
> them:
> disp @ca; setattr m autochain 0
> So, if you went with the tube approach your overall script could be
> something like
> open 4hhb
> ~ribbon; show @ca; setattr m autochain 0
> rlabel; setattr m residueLabelPos 2
> # open python file for custom labeling, not incl here
> # color alpha-carbons as you like:
> rainbow
> shape tube :.a at ca radius 0.35 bandLength 2 modelId 1
> shape tube :.b at ca radius 0.35 bandLength 2 modelId 2
> shape tube :.c at ca radius 0.35 bandLength 2 modelId 3
> shape tube :.d at ca radius 0.35 bandLength 2 modelId 4
> Image attached.  You may want to take a look at the tube options and try
> different values:
> <http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/shape.html>
> <http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/shape.html#tube>
> I hope this helps,
> Elaine
> ----------
> Elaine C. Meng, Ph.D.
> UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab
> Department of Pharmaceutical Chemistry
> University of California, San Francisco
> On May 15, 2011, at 10:56 AM, Daniel Gurnon wrote:
> > Hi all,
> > A student of mine wants to make a wire sculpture of a protein, and I'm
> thinking of ways Chimera could make the task easier. Ideally, I would create
> a script that would display any protein in wire-form, with residue positions
> clearly and unobtrusively labeled.
> >
> > I'd like to use the command line to display a backbone as a licorice
> ribbon with residue numbers and 1-letter codes at the alpha carbon of each
> residue.
> > so starting out, I would use:
> > ribscale licorice; ribbackbone; rlabel @ca;
> >
> > But instead of "ALA 24.B", I want "A 24". Though I can get what I want
> using the Actions menu, I can't find a way to create custom rlabels via the
> command line. Is there a way to do this?
> >
> > If possible, I would also like to position each label near the spot on
> the ribbon closest to the alpha carbon (the "primary atom"). I can see how
> to do this with the molecule attributes panel, but I'm having difficulty
> setting the placement through the command line.
> >
> > And while I'm at it...is there a way to color a spot on the ribbon
> closest to the alpha carbon a different color than the rest of the ribbon?
> > Thanks for the help!
> > Dan
> >


Daniel Gurnon, Ph. D.
Assistant Professor of Chemistry
DePauw University
Greencastle, IN 46135

p: 765-658-6279
e: danielgurnon at depauw.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20110516/b4b57f1f/attachment.html>

More information about the Chimera-users mailing list