[Chimera-users] extracting chaing colors from session file?

Eric Pettersen pett at cgl.ucsf.edu
Tue Sep 6 11:13:42 PDT 2016


Hi Melissa,
	Here’s a little Python script that will go through your molecular models and print out the “modelcolor” command that would give them their current color.  You can run the script simply by opening it with the “open” command or with the File->Open dialog.  The commands will appear in the Reply Log.

—Eric

	Eric Pettersen
	UCSF Computer Graphics Lab




> On Sep 3, 2016, at 11:23 AM, Melissa Jurica <mjurica at ucsc.edu> wrote:
> 
> Thanks Elaine-
> 
> My structures have more than 20 individual components (recent spliceosome cryo-EM models- example PDB 5GMK).  They came as 1 model, which I split to have more control over for analysis.  I can go through each component by hand and copy/paste the color for each model into a text file and then turn then this into a command file to color another structure with the same components in another conformation.  (Thanks for turning me on to the “modelcolor” command.  That will be helpful!) However, I was hoping there was a way to use something like grep to extract this information from the .py session file.
> 
> Melissa
> 
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Melissa S. Jurica, Ph.D.
> Professor, Molecular, Cell & Developmental Biology
> Center for Molecular Biology of RNA
> University of California, Santa Cruz
> 1156 High Street
> Santa Cruz, CA 95064
> 
> Office: 450 Sinsheimer Labs	Lab: 434 Sinsheimer Labs 
> Office phone (831) 459-4427	Lab phone (831) 459-2463	Fax (831) 459-3139
> http://www.mcd.ucsc.edu/faculty/jurica.html <http://www.mcd.ucsc.edu/faculty/jurica.html>
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> On Sep 2, 2016, at 5:11 PM, Elaine Meng <meng at cgl.ucsf.edu <mailto:meng at cgl.ucsf.edu>> wrote:
> 
>> Hi Melissa,
>> At first I was going to suggest “mcopy” but from your description, it sounds like you have each chain as a separate model.  “mcopy” is only for copying settings within one model to other models.
>> <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/mcopy.html <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/mcopy.html>>
>> 
>> You can get the current atom-color RGB definitions or hex codes by Ctrl-click to select an atom (or ribbon segment to select the whole residue, if all of its atoms are the same color), showing the Selection Inspector, Inspect: atom, and then clicking the square color well to get the Color Editor.  Then in the Color Editor you can see the hex code starting with # in the “Color name” field.
>> 
>> The square in the Model Panel shows the model-level color.  Chimera has a coloring hierarchy, where if the atoms are individually assigned colors (such as with your color command), in the 3D display those colors mask the model-level color, which may be different.  You can use the modelcolor command, for example “modelcolor #6168c8fb41bc #0.17” or click the color square in the Model Panel to make the Color Editor dialog appear, and then enter the hex code in the “Color name” field of the Color Editor: 
>> <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/colortool.html <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/colortool.html>>
>> There is only one model-level color per model, as the name suggests, even though the atoms and per-residue ribbon segments might be all different colors.
>> 
>> More about color hierarchy:
>> <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/hierarchy.html <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/hierarchy.html>>
>> 
>> 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 Sep 2, 2016, at 1:23 PM, Melissa Jurica <mjurica at ucsc.edu <mailto:mjurica at ucsc.edu>> wrote:
>> 
>>> I am analyzing a structure containing many individual chains that I have colored.  I would like to transfer these colors to another structure of the same complex in a different conformation.  Is there a way to extract the colors into a text file so that I can write a command file with the same color designations?
>>> 
>>> For example:
>>> 
>>> color #6168c8fb41bc #0.17
>>> 
>>> Also-
>>> How do I get that color to apply to the little square that shows up on the model panel?
>>> 
>>> Melissa
>> 
> 
> _______________________________________________
> 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/20160906/a7aa1ee1/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: getcolors.py
Type: text/x-python-script
Size: 170 bytes
Desc: not available
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20160906/a7aa1ee1/attachment-0001.bin>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20160906/a7aa1ee1/attachment-0003.html>


More information about the Chimera-users mailing list