Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help
Special pages
SBGrid Resources
SBGrid Consortium
SBGrid Data Bank
Software Webinars
PyMOL Webinar
PyMOL Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Advanced Coloring
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=Coloring Molecules= ==Basic Coloring== Any molecule in PyMOL can be assigned a color using the small rightmost buttons in the object list (in the upper right part of the main GUI window. The [[Color]] command will do the same. PyMOL has a predefined set of colors that can be edited in the ''Settings->Colors'' menu. Alternatively, you can use the [[Set_Color]] command. ==Coloring secondary structures== To assign helices, sheets and loops individual colors, do: <source lang="python"> color red, ss h color yellow, ss s color green, ss l+'' </source> When the colour bleeds from the ends of helices and sheets into loops, do: <source lang="python"> set cartoon_discrete_colors, 1 </source> Or activate ''Cartoon -> Discrete Colors'' in the GUI menu. ==Coloring by atom type== The util.cba* ("Color By Atom") commands color atoms according to type: oxygen in red, nitrogen in blue, hydrogen in white. Carbon will get a different colors, depending on the command: {| ! command ! carbon color |- | util.cba'''g''' | green |- | util.cba'''c''' | cyan |- | util.cba'''m''' | light magenta |- | util.cba'''y''' | yellow |- | util.cba'''s''' | salmon |- | util.cba'''w''' | white/grey |- | util.cba'''b''' | slate |- | util.cba'''o''' | bright orange |- | util.cba'''p''' | purple |- | util.cba'''k''' | pink |} For instance: <source lang="python"> util.cbay three </source> will color the object ''three'' by atom type, with the carbon atoms in yellow. The util.cnc command will color all the atoms according to type, as in the util.cba* commands stated above, except for the C-atoms. For instance: <source lang="python"> util.cnc three </source> will color the object ''three'' by atom type, but leave the color of the C-atom unaltered. ==CMYK-safe Colors== There are two distinct color spaces on computers: RGB (red-green-blue), which is for screens, and CMYK (cyan-magenta-yellow-black), which is for printing. Some RGB triplets do not have equivalents in CMYK space. As a result, a figure that looks great on a screen can come out with unpredictable colors when printed. Most applications do a good job with RGB-to-CMYK conversions for photos, but do not do such a good job with graphics that use pure primary colors. For example, reds are generally OK, but pure blues and greens do not translate very well. Here are some RGB values that are within the CMYK gamut (i.e. are "CMYK-safe"): <source lang="python"> #optimized rgb values for cmyk output: set_color dblue= [0.05 , 0.19 , 0.57] set_color blue= [0.02 , 0.50 , 0.72] set_color mblue= [0.5 , 0.7 , 0.9 ] set_color lblue= [0.86 , 1.00 , 1.00] set_color green= [0.00 , 0.53 , 0.22] set_color lgreen=[0.50 , 0.78 , 0.50] set_color yellow=[0.95 , 0.78 , 0.00] set_color orange=[1.00 , 0.40 , 0.0 ] # these are trivial set_color red= [1.00 , 0.00 , 0.00] set_color mred= [1.00 , 0.40 , 0.40] set_color lred= [1.00 , 0.80 , 0.80] set_color vlred= [1.00 , 0.90 , 0.90] set_color white= [1.00 , 1.00 , 1.00] set_color vlgray=[0.95 , 0.95 , 0.95] set_color lgray= [0.90 , 0.90 , 0.90] set_color gray= [0.70 , 0.70 , 0.70] set_color dgray= [0.50 , 0.50 , 0.50] set_color vdgray=[0.30 , 0.30 , 0.30] set_color black= [0.00 , 0.00 , 0.00] ## </source> Note that there are default atom colors such as "carbon", "nitrogen", "oxygen", "hydrogen", "sulfur", etc. which should also be redefined: <source lang="python"> set_color carbon= [0.00 , 0.53 , 0.22] etc. </source> ==Coloring with 'chainbows' from a script== The chainbow function can be invoked by: <source lang="python"> util.chainbow("object-name") </source> ==Assign color by B-factor== B-factor coloring can be done with the [[spectrum]] command. Example: spectrum b, blue_white_red, minimum=20, maximum=50 as cartoon cartoon putty
Summary:
Please note that all contributions to PyMOL Wiki are considered to be released under the GNU Free Documentation License 1.2 (see
PyMOL Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Advanced Coloring
(section)
Add topic