[Chimera-users] Command-line equivalents of interative action

Eric Pettersen pett at cgl.ucsf.edu
Thu Jul 13 11:02:47 PDT 2017


I’ve attached a Python script that if you run it (simply by opening it) will show worms with a radius of 0.05 for residues with no “mavConservation” attribute and half the conservation plus one for residues with such an attribute.  It should be pretty easy to modify for your needs.  Keep in mind that if you are using AL2CO conservation measures, the conservation value could be negative.

—Eric

	Eric Pettersen
	UCSF Computer Graphics Lab




> On Jul 13, 2017, at 9:33 AM, Elaine Meng <meng at cgl.ucsf.edu> wrote:
> 
> Hi Joe,
> Glad you like the color-by-conservation tutorial!
> 
> Assuming that the structure associates with the alignment automatically, you can do all of this with Chimera commands, except worms, for which there is no command.  Somebody else would have to weigh in on whether it would be feasible to render worms with a python script.
> 
> In the script, just open the structure and alignment with the “open” command and do the coloring with the “rangecolor” command, like the example shown in the tutorial.  As in the Render by Attribute dialog, you are not limited to the built-in color palettes.  In the GUI you can click the color well and get the color editor and choose any color;  in the rangecolor command, you can specify any colors, whether built-in or custom-defined.
> 
> You can control the conservation method by setting your preferences beforehand, by opening some (any) sequence alignment, and in the Multalign Viewer (sequence window) menu: Preferences… Headers, then choosing the desired settings. If AL2CO, “gap fraction” is the maximum fraction of sequences with gaps in a column for conservation to still be calculated; for example, if the gap fraction is 0.25, conservation values will only be calculated for columns in which at least three-fourths of the sequences have residues (hence the “novalue” coloring in the rangecolor command below, for residues that don’t have a conservation value).  Also use Multalign Viewer menu Headers to ensure the Conservation line is shown, if it isn’t already.  I believe all of that is automatically saved for the next time you open an alignment.
> 
> Potential issues:
> - does the structure associate automatically with the sequence?  you may be able to set laxer criteria if needed in the Multalign Viewer preferences, Structure section
> - the potential ranges of conservation values could vary depending on the measure and alignments you use, so think about whether you would always want a specific color to go with a  specific conservation value, or just anchor the coloring to “min” “mid” “max” .  Try a few examples manually and see the min/mid/max values reported in the Reply Log when you run rangecolor, to get a feel for the variability of the values obtained with your data.
> 
> Here are lines for an example command file, but reasonable possibilities are much broader. The # lines are comments.
> 
> # to specify conservation method, set Multalign Viewer header preferences beforehand
> set bgcolor white
> set silhouette
> # define colors same as used in the Render tool's cyan-maroon palette
> colordef maroon2 .62 .125 .37
> colordef cyan2 .059 .78 .81
> # open structure
> open 1hd2
> # show ribbons only (hide atoms)
> ~disp
> # open sequence alignment
> open ~/Desktop/peroxiredoxinSFLD.afa
> # color by conservation
> rangecolor mavConservation min cyan2 0 white max maroon2 novalue gray
> 
> Further notes:
> - “copy” command to save image, “save” to save session, “close session” to close both the sequence alignment and structure
> 
> I hope this helps,
> Elaine
> ----------
> Elaine C. Meng, Ph.D. 
> UCSF Chimera(X) team
> Department of Pharmaceutical Chemistry
> University of California, San Francisco
> 
> 
>> On Jul 13, 2017, at 3:40 AM, Healey, Joe <J.R.J.Healey at warwick.ac.uk> wrote:
>> 
>> Hi Chimera Team,
>> I've been following this great tutorial:
>> https://www.cgl.ucsf.edu/chimera/data/tutorials/systems/outline.html#case1
>> 
>> To render a structure by conservation. I'd like to run this non-interactively for a number of proteins though. Could you tell me what the python or 'chimera code' equivalents would be?
>> 
>> For instance, I would provide a structure (or structures in a session) and MSA in fasta format already, so without interactive menus I'd like to:
>> 
>> 	• Open the structure(s) and MSA
>> 	• get the conservation from MultAlign (the actual conservation metric doesn't particularly matter to me at the moment)
>> 	• Render any open models by conservation, say using the cyan-maroon colour scale
>> 	• Additionall depict as smooth worms with defined min and max radii
>> 
>> If this is possible!
>> Thanks!
>> Joe
> 
> 
> _______________________________________________
> Chimera-users mailing list: Chimera-users at cgl.ucsf.edu
> Manage subscription: http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20170713/30ba34f0/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: worm.py
Type: text/x-python-script
Size: 335 bytes
Desc: not available
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20170713/30ba34f0/attachment.bin>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20170713/30ba34f0/attachment-0001.html>


More information about the Chimera-users mailing list