[Chimera-users] how to color an model by an attribute in chimerax

Elaine Meng meng at cgl.ucsf.edu
Tue Jan 26 08:09:28 PST 2021


On Jan 25, 2021, at 7:47 PM, sunyeping <sunyeping at aliyun.com> wrote:
> 
> Dear all,
> I wish to color an model  by an attribute in chimerax. The attribute is the entropy which is calculted by an external software. I wrote the entropy values of each residue in a text file (attr.txt) like the following:
> 
> attribute: entropy
> match mode: 1-to-1
> recipient: residues
>  :1 0.0
>  :2 0.0014948
>  :3 0.0090952
>  :4 0.0004805
>  :5 0.1102497
>  :6 0.0095258
>  :7 0.0008226
>  :8 0.0042205
>  :9 0.0037255
>  :10 0.0006678
>  :11 0.0027988
>  :12 0.0193925
>  :13 0.0153925
>  :14 0.0052115
>  :15 0.0020136
> ..........
> However, when I input the command "color byattr attr.txt", I get the following error information:
> "No known/Registered attribute attr.txt"
> 
> Could anyone tell me what is the correct way to do this?
> With many thanks.
> Best regards


Hello,
Since this is a ChimeraX question, better to send to the chimerax-users at cgl.ucsf.edu address CC'd here instead of the chimera-users list.

(1) First you need to make sure the text file is the right format.  It should be tabs (not just a space) before the residue number and between the residue number and the value, e.g. as described here:
<https://rbvi.ucsf.edu/chimerax/docs/user/formats/defattr.html>

(2) Then (after the atomic structure is open), open the attribute file with the "open" command, e.g. with pathname of your file, or if you want use a file browser window to find the file, "open browse". It is easiest to first name the file ending in .defattr so that ChimeraX will know what kind of file it is supposed to be.
<https://rbvi.ucsf.edu/chimerax/docs/user/commands/open.html#defattr>

(3) then the Log should report that the attribute named entropy is assigned and you are ready to do the coloring. The coloring command could be something like

color byattribute entropy palette rainbow

...there are several other options, see
<https://rbvi.ucsf.edu/chimerax/docs/user/commands/color.html#byattribute>

I hope this helps,
Elaine
-----
Elaine C. Meng, Ph.D.                       
UCSF Chimera(X) team
Department of Pharmaceutical Chemistry
University of California, San Francisco




More information about the Chimera-users mailing list