Colorizing
In SAMSON, you can colorize visual models, meshes, labels, and structural nodes (residues, atoms, etc.) using various color schemes. Color schemes may be used to e.g. assign a constant color to a node, colorize atoms by residue, chain, etc, or based on some node property (e.g., temperature factor, side chain charge, etc.). You can apply different color schemes to different nodes.
A color scheme is applied to a node via a material which contains not only a color scheme but also other appearance options such as metallic, roughness, transmission, etc. When a color scheme or, more generally, a material is applied to a node, all the node's descendants are affected.
Interactive tutorial in SAMSON (Help > Tutorials): "Visualization: visual models and colorization".
What you will learn from this tutorial:
- About color schemes in SAMSON.
- How to apply color schemes.
- About color palettes in SAMSON.
- How to modify the already applied material via the Inspector.
What is not covered in this tutorial:
For how to move apply various visualizations, please, refer to the Visualizing section.
Color schemes#
SAMSON provides the following color schemes:
- Constant: applies a constant color.
- Constant illustrative: applies a constant color (illustrative). It helps to depict molecules in a style similar to David S. Goodsell's artwork.
- CPK: the classic Corey-Pauling-Koltun color scheme. This is the default color scheme for structural nodes.
-
Per attribute: the color is determined based on a structural node attribute. The following per-attribute color scheme are available:
-
Chain - colorizes per chain ID.
- Chain (illustrative) - colorizes per chain ID in a style similar to David S. Goodsell's artwork.
- Formal charge - colorizes based on formal charges of atoms.
- Occupancy - colorizes based on atom occupancies.
- Partial charge - colorizes based on partial charges of atoms.
- Temperature factor - colorizes based on temperature factor of atoms.
- Residue index - colorizes based on the residue id.
- Residue type - colorizes based on the residue type.
- Secondary structure type - colorizes based on the residues' secondary structure.
- Side chain charge - colorizes residues based on their standard side chain charge.
- Side chain polarity - colorizes residues based on their standard side chain polarity.
- Custom... - choose a per attribute color scheme and a color palette.
The per attribute color schemes colorize using their default color palette, which you can change using the Inspector or by colorizing using Custom....
You can see some of the default per-attribute color schemes on the image below.
Applying color schemes#
Color schemes can be applied to selected nodes in several ways:
- Select a node and, in the context toolbar menu, click on the material.
- Select a node and apply the colorization using Visualization > Color.
- Select a node and change/apply the colorization in the Inspector via a material (see Changing materials in the Inspector section below).
In the example below, we apply different color schemes to the Ribbons visual model using the above-mentioned ways.
Open a molecule, e.g. download a protein from RCSB PDB using Home > File > Fetch. Select a structural model in the Document view and apply a constant color scheme via its context toolbar as shown in the image below or via the Visualization > Color.
A dialog will appear in which you can choose the color.
As a result, all the chosen nodes will be colorized with the same color.
Note
You can always undo operations by clicking Edit > Undo (1).
- , : Ctrl+Z, : Cmd+Z
You can see which nodes have materials in the Document view - it is indicated with the material icon as shown in the image below:
Now, select a structural model and apply a per attribute color scheme, e.g. the "Residue hydrophobicity" color scheme in case you have a protein selected. For that, go to the Visualization > Color > Per attribute > Residue hydrophobicity as shown in the image below or use the context toolbar.
As a result, all residues will be colorized according to their hydrophobicity.
To reset the colorization to the default one, select the node and in the context toolbar select Color > Reset color as shown in the image below or go to Visualization > Color > Reset color.
If you want to reset the colorization, then select the node and, either in the toolbar menu or in the Visualization menu, click on Color > Reset color, or simply clear it via the Inspector.
Color palettes#
Each per attribute color scheme has its own default color palette. You can modify it using the Inspector, or you can colorize using Color > Custom.... The later one opens a dialog window in which you can choose which color scheme to apply and what color palette to use.
A color palette defines how the colors change depending on the value to which the color scheme is associated. In SAMSON, the following color palette types are available:
- A standard color palette in the HSV (Hue-Saturation-Value) color space.
- Discrete color palettes
- A set of color palettes in the HCL (Hue-Chroma-Luminance) color space:
See the tables of default HCL color palettes available in SAMSON with their color bars.
Note
The HCL color space is better suited for human perception - you can directly control the color (hue), the "colorness" (chroma) and the luminance (brightness). SAMSON provides by default most of the HCL color palettes available in R and Python. See https://hclwizard.org for more information on the advantages of the HCL color space.
Note
You can revert left and right arms of color palettes by checking the "Reverse" option at the top of the dialog.
If you want to see how your system looks like with color palettes while switching between them, then, at the bottom of the color palette window check the "Auto update" option or click the Update button. Please note that it might be slow for big systems.
At the bottom of the color palette window you can find the Color Vision Deficiency Emulator which shows how the current color palette will be perceived by people with certain color vision deficiencies:
You can also create your own color palettes in the HCL color space by copying the parameters from the existing one, checking the "Custom HCL palette" option, and modifying it. You can save your color palette as a new one for later use - it will be stored in your local SAMSON configurations.
Changing materials in the Inspector#
Prerequisites: Please refer to the Inspecting section to learn how to inspect nodes in SAMSON.
You can view and modify materials applied to nodes in the Inspector.
You can add a material from the Inspector as follows:
You can modify the reset the color scheme and choose another one:
For a constant color scheme you can modify its color, and for a per-attribute color scheme you can modify its color palette by clicking on the color bar:
For per-attribute color schemes, you can also modify their range by altering the min and max values. This might be useful when you would like to have a specific range for colorization based on, for example, the temperature factor.
You can apply an appearance preset for a material in the Inspector: