Custom colour for atoms with bfactor==0

Hi, I wanted to know if there is a way of colouring my structure by bfactor, but with an additional condition where all bfactor==0 atoms are coloured in grey. Currently, I am using a white to red gradient for my B-factors: color bfactor range -2.2, 2.2 In this case, bfactor==0 values are coloured white. However, I would like them to be grey and outside the gradient (as they represent an unmapped portion of the protein). Thanks! Lorena

Hi Lorena, Just use this additional command after your initial bfactor coloring: color @@bfactor=0 gray target a The "target a" part is to limit to atoms, assuming you don't also want to color ribbons, surfaces, etc. If you do want to color those representations, just omit that part. See command-line specification by attribute value: <https://rbvi.ucsf.edu/chimerax/docs/user/commands/atomspec.html#attributes> By the way, you don't have to use the bfactor column to assign atoms values and use them for coloring. You can instead make any number of your own custom attributes by reading in an attribute assignment file (simple text format) and then use it for coloring with the "color byattribute" command. See <https://rbvi.ucsf.edu/chimerax/docs/user/attributes.html> <https://rbvi.ucsf.edu/chimerax/docs/user/formats/defattr.html> <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
On Jul 26, 2021, at 12:05 PM, Lorena Zuzic via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hi, I wanted to know if there is a way of colouring my structure by bfactor, but with an additional condition where all bfactor==0 atoms are coloured in grey. Currently, I am using a white to red gradient for my B-factors:
color bfactor range -2.2, 2.2
In this case, bfactor==0 values are coloured white. However, I would like them to be grey and outside the gradient (as they represent an unmapped portion of the protein).
Thanks! Lorena

Hi Elaine, Thank you, that worked perfectly! Also, a separate attribute file sounds like a useful feature, worth a try. Kind regards, Lorena ________________________________ From: Elaine Meng <meng@cgl.ucsf.edu> Sent: 26 July 2021 22:23 To: Lorena Zuzic <lorena.zuzic@postgrad.manchester.ac.uk> Cc: chimerax-users@cgl.ucsf.edu <chimerax-users@cgl.ucsf.edu> Subject: Re: [chimerax-users] Custom colour for atoms with bfactor==0 Hi Lorena, Just use this additional command after your initial bfactor coloring: color @@bfactor=0 gray target a The "target a" part is to limit to atoms, assuming you don't also want to color ribbons, surfaces, etc. If you do want to color those representations, just omit that part. See command-line specification by attribute value: <https://rbvi.ucsf.edu/chimerax/docs/user/commands/atomspec.html#attributes> By the way, you don't have to use the bfactor column to assign atoms values and use them for coloring. You can instead make any number of your own custom attributes by reading in an attribute assignment file (simple text format) and then use it for coloring with the "color byattribute" command. See <https://rbvi.ucsf.edu/chimerax/docs/user/attributes.html> <https://rbvi.ucsf.edu/chimerax/docs/user/formats/defattr.html> <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
On Jul 26, 2021, at 12:05 PM, Lorena Zuzic via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hi, I wanted to know if there is a way of colouring my structure by bfactor, but with an additional condition where all bfactor==0 atoms are coloured in grey. Currently, I am using a white to red gradient for my B-factors:
color bfactor range -2.2, 2.2
In this case, bfactor==0 values are coloured white. However, I would like them to be grey and outside the gradient (as they represent an unmapped portion of the protein).
Thanks! Lorena
participants (2)
-
Elaine Meng
-
Lorena Zuzic