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).<div><br></div><div>As I understand it, if the script is to work with any pdb structure, I will need two segments of python code:</div>
<div><br></div><div>1) custom residue labeling to display only 1-letter code and number, and</div><div>2) something that creates a separate tube for each chain in a model, without connecting one tube to the next.</div><div>
<br></div><div>I would love to wrap this into a button (e.g., <a href="http://www.cgl.ucsf.edu/chimera/1.4/docs/ProgrammersGuide/Examples/Main_ToolbarButton.html">http://www.cgl.ucsf.edu/chimera/1.4/docs/ProgrammersGuide/Examples/Main_ToolbarButton.html</a>) that 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.</div>
<div><br></div><div>Thanks as always for the help.</div><div>Dan</div><div><br></div><div><br></div><div><br><div class="gmail_quote">On Mon, May 16, 2011 at 12:55 PM, Elaine Meng <span dir="ltr"><<a href="mailto:meng@cgl.ucsf.edu">meng@cgl.ucsf.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Dan,<br>
You'd probably also want to undisplay atoms/bonds, so something like<br>
<br>
~disp; ribbon; ribsc licorice<br>
<br>
(A) label positioning. You could either use residue labels with "primary atom" positioning or atom labels at CA showing residue info, i.e. :<br>
<br>
rlabel; setattr m residueLabelPos 2<br>
- OR -<br>
disp @ca; labelopt info residue; la @ca<br>
<br>
(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.<br>
<br>
(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:<br>
<<a href="http://plato.cgl.ucsf.edu/pipermail/chimera-users/2010-October/005622.html" target="_blank">http://plato.cgl.ucsf.edu/pipermail/chimera-users/2010-October/005622.html</a>><br>
<br>
(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:<br>
<<a href="http://www.cgl.ucsf.edu/chimera/docs/ContributedSoftware/ribbonstyle/ribbonstyle.html#offset" target="_blank">http://www.cgl.ucsf.edu/chimera/docs/ContributedSoftware/ribbonstyle/ribbonstyle.html#offset</a>><br>
<br>
... but briefly, something like:<br>
<br>
~ribbon; rainbow<br>
shape tube :.a@ca radius 0.35 bandLength 2 modelId 1<br>
<br>
... 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.<br>
<br>
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:<br>
<br>
disp @ca; setattr m autochain 0<br>
<br>
So, if you went with the tube approach your overall script could be something like<br>
<br>
open 4hhb<br>
~ribbon; show @ca; setattr m autochain 0<br>
rlabel; setattr m residueLabelPos 2<br>
# open python file for custom labeling, not incl here<br>
# color alpha-carbons as you like:<br>
rainbow<br>
shape tube :.a@ca radius 0.35 bandLength 2 modelId 1<br>
shape tube :.b@ca radius 0.35 bandLength 2 modelId 2<br>
shape tube :.c@ca radius 0.35 bandLength 2 modelId 3<br>
shape tube :.d@ca radius 0.35 bandLength 2 modelId 4<br>
<br>
Image attached. You may want to take a look at the tube options and try different values:<br>
<br>
<<a href="http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/shape.html" target="_blank">http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/shape.html</a>><br>
<<a href="http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/shape.html#tube" target="_blank">http://www.cgl.ucsf.edu/chimera/docs/UsersGuide/midas/shape.html#tube</a>><br>
<br>
I hope this helps,<br>
Elaine<br>
----------<br>
Elaine C. Meng, Ph.D.<br>
UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab<br>
Department of Pharmaceutical Chemistry<br>
University of California, San Francisco<br>
<br>
<br><br>
<br>
On May 15, 2011, at 10:56 AM, Daniel Gurnon wrote:<br>
<br>
> Hi all,<br>
> 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.<br>
><br>
> 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.<br>
> so starting out, I would use:<br>
> ribscale licorice; ribbackbone; rlabel @ca;<br>
><br>
> 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?<br>
><br>
> 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.<br>
><br>
> 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?<br>
> Thanks for the help!<br>
> Dan<br>
><br>
<br>
<br></blockquote></div><br><br clear="all"><br>-- <br>____________________________<br><br>Daniel Gurnon, Ph. D.<br>Assistant Professor of Chemistry<br>DePauw University<br>Greencastle, IN 46135<br><br>p: 765-658-6279<br>
e: <a href="mailto:danielgurnon@depauw.edu">danielgurnon@depauw.edu</a><br>
</div>