[chimerax-users] fade colors in ChimeraX movie script
Elaine Meng
meng at cgl.ucsf.edu
Sun Feb 26 11:32:42 PST 2023
Hi Matt,
Yes, you can certainly gradually fade from one color to another with ChimeraX commands. I assume you really meant ChimeraX (rather than Chimera) since you sent this to the chimerax-users at cgl.ucsf.edu address.
If the structure is not moving you can do a simple crossfade, e.g. with "movie crossfade" (if you are recording a movie, but will not be shown interactively) or "crossfade" (to see it interactively):
<https://rbvi.ucsf.edu/chimerax/docs/user/commands/movie.html#crossfade>
<https://rbvi.ucsf.edu/chimerax/docs/user/commands/crossfade.html>
If the structure is moving (e.g. rotating) during the desired color fade, it is a little more complicated but could be done with a "perframe" command where you can change the R,G,B color components from start and end values over a desired number of frames.
For example, here is a little command script that will open crambin and color some residues blue at the start and fade some of them to red while the structure is rotating:
open 1crn
name res1 /A:21,28
name res2 /A:30,39
color res1 blue
color res2 blue
roll y 0.4 900; perframe "color res2 $1,0,$2" range 0,100,0.111 range 100,0,-0.111; wait 900
Of course, you could instead show sidechains and color only the atoms, or color both ribbon and atoms, etc. Your script will be more complicated since you have multiple stages and you will need to figure out what R,G,B you want at each point and use multiple perframe commands (since presumably it is not a single linear ramp from the first structure to the last).
Perframe can be a little tricky (just may take a bit of trial and error on your part) but is very powerful at making gradual changes.
<https://rbvi.ucsf.edu/chimerax/docs/user/commands/perframe.html>
See also the "making movies" page:
<https://rbvi.ucsf.edu/chimerax/docs/user/movies.html>
I hope this helps,
Elaine
-----
Elaine C. Meng, Ph.D.
UCSF Chimera(X) team
Department of Pharmaceutical Chemistry
University of California, San Francisco
> On Feb 26, 2023, at 3:04 AM, Matthew Wengler (TSL) via ChimeraX-users <chimerax-users at cgl.ucsf.edu> wrote:
>
> Hello,
>
> I am a PhD student studying the downstream signalling events of a kinase in a fungal plant pathogen. We have differential phosphopeptide data of the kinase itself over a time course during plant infection (i.e., four residues on this kinase are differentially phosphorylated during stages of infection). I had a vision of showing a movie that incorporated the phosphorylated residues x phosphorylation abundance x time on the kinase’s tertiary structure and was wondering if this could be possible with Chimera X:
>
> • The tertiary structure would be displayed in grey
> • The phosphorylated residues would be highlighted in blue
> • A movie would be played and the highlighted residues would change colour based on phosphopeptide abundance over a time course (ranging from 0-100% abundance = blue -> red)
>
> I was wondering if this was currently possible.
>
> Alternatively (and maybe this is really the easiest way), because we only have ~6 time points, I could have 6 different stills of the protein with the residues highlighted corresponding to the phosphopeptide abundance values (blue-red 0-100%) and then piece them together in a 6 frame video that will loop…? I think I would prefer the colours to blend slower together dynamically than 6 harsh frames.
>
> Would there be a way to do this in Chimera?
>
> Thank you,
> Matt Wengler
More information about the ChimeraX-users
mailing list