Visualizing

SAMSON provides various visualization tools (visual models, visual presets, etc) and rendering options (styles, special effects, etc) to help you analyze molecular systems and create beautiful visualizations and animations.

In this section, we will show how to use SAMSON's visualization tools and rendering options.

# Applying visual presets

The fastest way to visualize a molecular system is by applying visual presets to it. Visual presets provide an efficient way to apply multiple visual representations and color schemes simultaneously to a complex molecular system based on selectors, all in just a few clicks. SAMSON provides a set of default visual presets and you can create and save your own visual presets, e.g., by modifying the existing ones. See the Visual presets section on how to apply and create visual presets.

To apply a visual preset click on Visualization menu > Visual preset or Biology menu > Visual preset and, in the pop-up window, select a visual preset among the existing ones and click apply.

The visual preset is applied to the selected nodes or to the whole document if nothing is selected. The visual models created by the visual preset are stored in the document in a folder named based on the visual preset.

In the example below, the receptor is shown as ribbons, ligands and waters are represented as licorice, and ions are shown through a van der Waals representation in just a few clicks.

Applying a visual preset

Please refer to Visual presets section for more information on how to apply visual presets and create your own visual presets.

Further in this section you will learn how to apply visual models, colorize, and change various rendering effects.

# Applying illustrative style

Another fast way to visualize your system is by applying an illustrative visualization and rendering style inspired by the RCSB PDB Molecule of the Month style by David S. Goodsell (RCSB PDB-Rutgers and The Scripps Research Institute). For that, simply click on Visualization menu > Visualize > Illustrate. It applies an illustrative visual preset (the van der Waals visual model for receptors and ligands with the color per chain ID (illustrative) and the van der Waals model for ions), and sets the rendering preferences to resemble the illustrative style. The colorization is done in the way that it resembles the Molecule of the Month style by David S. Goodsell.

Applying the illustrative visualization and rendering style

To reset the reset the view and the rendering style, remove the applied visual models in the Document view and choose Default in Visualization menu > Effects as shown in the Changing rendering style subsection.

# Changing rendering style

SAMSON provides several predefined rendering style between which you can easily switch in Visualization menu > Effects.

Switching between rendering styles

Rendering styles make it possible to quickly switch between different sets of special rendering effects like ambient occlusion, lighting, fog, shadows. You can also easily change these rendering effects in Visualization menu > Effects or directly in Preferences as described below.

# Capturing viewport

To save a picture, you can capture the SAMSON's viewport by pressing F10. You can modify the capture preferences in the Preferences > Interface > Captures panel (Interface menu > Preferences). See Captures preferences for more information.

Press F10 to take the viewport capture, the captured image is saved in the folder specified in capture preferences. Press Ctrl/ Cmd⌘+ 10 to take the viewport capture and choose where to save it. Press Shift+ 10 to copy the viewport capture to the clipboard.

The captures preferences

# Hiding and showing nodes

You can hide from displaying in the viewport any group of structural nodes (atoms, chains, residues, molecules, etc), folders, visual models, meshes, and some other nodes. When you hide a parent node its children nodes will be automatically hidden as well, e.g. if you hide a residue then atoms in this residue will be hidden, but you can make the descendant nodes visible while their parent node is hidden.

You can hide a node just by unticking the box of this node in the document view. For example, in the image below the chain B is hidden and won't be visible in the viewport. You can show a node by ticking the box back.

Hiding a node

Note: If at least one descendant of a node is visible then the node's box in the document view will be shown as ticked to depict that some of its descendants are visible.

To change the visibility of nodes, select them in the document view or in the viewport, then right-click and in the context menu go to the Visibility section where you can change the visibility of the selection and of all nodes. For example, in the image below we are to hide two chains.

Hiding the selection

Also, you can hide/show nodes using Python Scripting.

# Transparency

For some nodes (structural models, folders, labels, and many visual models, meshes) you can modify their transparency by selecting them and changing this parameter in the Inspector.

Changing the transparency of a structural model in the Inspector

Here is how, a semi-transparent structural model might look like along an opaque secondary structure visual representation:

A semi-transparent structural model

# Representation of atoms and bonds

Atoms and bonds in structural models have a default visual representation, where atoms are represented as balls and bonds as sticks.

You can modify it in Preferences > Rendering > Structural models:

The structural model settings

Try various options, constant atoms size or atom size proportional to van der Waals raduis, and various parameters for atom and bond sizes to see how it affects the display of molecules. If the Automatically test box is checked, this immediately affects the rendering in the viewport.

For example, here is how a molecule looks like with the "Constant atom size" option and the default atom radius (0.3Å):

A molecule with the default constant atom and bond sizes

And here how the same molecule looks like with the "Atom size proportional to van der Waals raduis" option.

A molecule with atom sizes proportional to van der Waals radii

# Adding visual models

Visual models provide alternate visual representations of structural models, or even some arbitrary shapes, that may be displayed in the viewport.

Let's open a molecule, e.g. 1AF6 using the Fetch PDB (you can find this extension in the Apps menu > All or using the Find commands, apps and editors... in the top-left corner of SAMSON) which will download it from RCSB PDB. We will apply a Ribbons (secondary structure) visual model to it.

Important: When a new visual model is added to the document, it is applied to the current selection, or, if nothing is selected, to the whole document. So, before adding a visual model make sure that a system to which you would like to apply it is selected and nothing else is selected, or nothing is selected if you would like to apply it to everything in the document.

Visual models may be added from the Visualization menu (Visualization > Visual model) or via Ctrl/ Cmd⌘ + Shift + V. A pop-up menu will appear asking you to choose a visual model type and provide a name for a visual model node that will be created. For example, let's choose the Ribbons (secondary structure) visual model.

Add visual model dialog

As a result, a new visual model will be added in the document. You can also hide the structural model by unticking the box.

Secondary structure

Provided they handle them, visual models can be colorized with color schemes. This is the case for the Ribbons (secondary structure) visual model which we added before (when no color scheme is applied, a default color scheme based on the residue sequence numbers is used, as in the picture above). For more information see the Colorizing section.

As other node, you can colorize a visual model in several ways:

• right-click on the visual model and, in its context menu, go to Set color;
• select the visual model and change/apply a color scheme in the Inspector;
• select the visual model and apply a color scheme from Biology menu > Colorize for per-attribute color schemes or from Visualization menu > Colorize for constant colors.

In the example below, we apply different color schemes to the Ribbons visual model using the above-mentioned ways.

Applying different color scheme to a visual model

You can apply several visual models at once even to the same nodes. For example, try applying the Licorice visual model: select a molecule, click Ctrl/ Cmd⌘ + Shift + V, and choose the Licorice visual model.

# Colorizing

See the Colorizing section.

# Special effects

Several rendering effects may be applied from the Preferences panel.

## Ambient occlusion

Ambient occlusion improves the perception of depth in molecules, by simulating the fact that deeper regions are less accessible to light, and are thus darker.

Two types of ambient occlusion are handled in SAMSON:

• Screen-space ambient occlusion efficiently provides an approximate simulation, but is sensitive to the distance to the camera.
• Object-space ambient occlusion is more realistic, but slower. Even screen-space ambient occlusion is very useful to improve depth perception however.

The ambient occlusion settings may be changed in the Rendering / Ambient occlusion section of the Preferences panel:

The ambient occlusion settings

The screen-space ambient occlusion can be switched on/off in one click in the Visualization menu > Effects.

Here is the Ribbons visual model of 1AF6 without ambient occlusion:

No ambient occlusion

And here it is with enabled screen-space ambient occlusion:

With ambient occlusion

## Anti-aliasing

Anti-aliasing removes jagged edges from images, and may significantly improve rendering. The anti-aliasing settings may be changed in the Rendering / Ambient occlusion section of the Preferences panel. Fast Approximate Anti-Aliasing (FXAA) is typically very efficient, and can be activated on most recent graphics cards.

Note: Anti-aliasing requires more rendering from your GPU and therefore may slow-down the visualization for big systems.

The anti-aliasing settings

Without anti-aliasing (choose Best speed from the list: multisampling factor set to 1, no FXAA), edges are very visible:

No anti-aliasing

With FXAA and multisampling set to 2 (choose Higher quality from the list), edges are much smoother, and pixel boundaries are much less visible:

With anti-aliasing

## Background color

The background color of the viewport may be changed in the Rendering / Background section of the Preferences panel:

The background color preferences

Four options are available:

• SAMSON: the default SAMSON background;
• Black: an entirely black background;
• White: an entirely white background;
• Custom: a gradient from a user-defined top color to a user-defined bottom color;
• Image: you can set an image as a background.

Let's try to set a custom gradient background by choosing Custom and modifying the Custom top color and the Custom bottom color.

With a custom background

You can switch between different backgrounds easily in the Visualization menu > Effects and in the bottom of the Viewport.

You can always return to the default SAMSON background color.

## Depth-of-field rendering

This effect simulates the depth-of-field effect produced by actual cameras (e.g. blurred distant objects). If enabled, when you zoom in the molecule its distant parts will be blurred. The depth-of-field settings may be changed in the Rendering / Depth-of-field section of the Preferences panel:

The depth-of-field settings

Turn the depth-of-field on, set the strength to 80 and zoom on a molecule.

Depth-of-field

The depth-of-field can be switched on/off in one click in the Visualization menu.

## Fog

Basically, fog makes distant objects less visible. Fog attenuates distant parts by blending them progressively with the background. Turn it on to make it easier to focus on the foreground.

The near and far distances are based on the camera location and determine where the fog is enabled. Before the "near distance" there is no fog, after the "far distance" every node is invisible. The "strenght" parameter influences the speed at which the fog is appearing.

The fog settings may be changed in the Rendering / Fog section of the Preferences panel:

The fog settings

The fog can be switched on/off in one click in the Visualization menu.

Here is 1YRF again with both depth-of-field and fog:

Depth-of-field and fog

## Shadows

Shadows are particularly helpful to improve the perception of relative positions.

Note: In case of an old graphics card you may want to either disable this option, or choose the lower preset.

The shadows settings may be changed in the Rendering / Shadows section of the Preferences panel:

The shadows settings

The shadows can be switched on/off in one click in the Visualization menu.

Without shadows, it may be difficult to perceive the relative positions, e.g., of 1YRF to the graphene sheet behind it:

Without shadows

With shadows, however, this becomes much easier:

With shadows

## Lightning

In SAMSON, lighting can be modified in the Rendering > Lightning section of the Preferences panel:

The lighting parameters

This section makes it possible to control the parameters of the two point lights that illuminate the document, as well as global parameters. Each light has the following parameters:

• Light color: click the square to change the color of the light
• Light intensity (between 0 and 1): the intensity of the light
• Specular intensity (between 0 and 1): the intensity of the light reflection on surfaces. High values make surfaces look like plastic, while low values make surfaces look matte.
• Specular power (between 0 and 1000): the decay of specular reflection. High values produce sharper specular reflections.
• Longitude and latitude control the position of the light.

The first light is typically the main light, which is thus typically brighter than the second light (a “back light”).

Finally, three more parameters are global:

• Fresnel intensity (between 0 and 1): the amount of background light reflected at grazing angles
• Fresnel power (between 0 and 100): how fast the Fresnel effect decays
• Ambient light: the amount of light that reaches objects, even when the intensity of both lights is set to 0.

Try changing all parameters and see the impact on rendering (switch on the Automatically test check box in the bottom).

You can easily switch between various presets for lighting either in Visualization menu > Effects > Lighting or in Preferences > Rendering > Lightning.

if you want to reproduce the flat lighting, set the light intensity for both first and second light to zero, the ambient light to 0.8, and the Fresnel power to zero.

Flat lighting

## Silhouettes

Silhouettes make it easier to separate regions with different depths. The silhouettes settings may be changed in the Rendering / Silhouettes section of the Preferences panel.

The silhouettes settings

The silhouettes can be switched on/off in one click in the Visualization menu.

Let's create the Ribbons (secondary structure) visual model for 1YRF molecule and enable silhouettes with the thickness set to 1

1YRF with silhouettes

# Examples

## Dengue virus

Let's make the following image of the molecule with PDB code 3J27 (part of the Dengue virus):

3J27

You can reproduce this image via the following steps:

• Add the Ribbons (secondary structure) visual model ( Ctrl/ Cmd⌘ + Shift + V).
• Add the Licorice visual model.
• Hide the structural model of the molecule.
• Orient the molecule in the viewport.
• Colorize the Licorice visual model by the residue index (select the Licorice visual model and in the context menu choose Set color > Per attribute > Residue index).
• Ambient occlusion: enable object-space ambient occlusion with the default parameters.
• Anti-aliasing: enable with multisampling factor set to 2, enable FXAA.
• Background: white.
• Fog: enable with the far distance parameter set to 100Å.
• Lightning: default parameters for the first and second lights; set ambient light to 0.
• Shadows: enable with the default parameters.
• Silhouettes: disable.

## The nucleosome core particle

Let's make the following image of the molecule with PDB code 1EQZ (the nucleosome core particle):

1EQZ

You can reproduce this image via the following steps:

• Orient the molecule in the viewport: click on the Back view icon (menu: Visualization > Camera > Back view, Ctrl/ Cmd⌘ + 9).
• In the document view, expand the molecule to see chains. Select chains from A to H and apply the Ribbons (secondary structure) visual model ( Ctrl/ Cmd⌘ + Shift + V), and then hide the selection (right-click, Visibility > Hide selection).
• Select the Ribbons (secondary structure) visual model and colorize it with a constant color (white).
• Open Preferences, modify the structural models representation (Rendering > Structural models): set the atom radius to 1Å.
• Select the chain I and colorize it with a constant color. Colorize the chain J with a constant color.
• Ambient occlusion: disable.
• Anti-aliasing: enable with multisampling factor set to 2, enable FXAA.
• Background: white.
• Fog: enable with the default parameters.
• Lightning: default parameters.
• Shadows: enable with the default parameters.
• Silhouettes: enable and set the silhouette opacity to 60%.

## Pilus machine

Let's reproduce an image of the molecule with PDB code 3JC8 (the type IVa pilus machine in a piliated state).

3JC8

Here we colorized 3JC8 by groups of chains. Please, download 3JC8.sam file in which for simplicity we combined chains in groups.

You can reproduce this image via the following steps:

• Orient the molecule in the viewport: click on the Top view icon (menu: Visualization > Camera > Back view, Ctrl/ Cmd⌘ + 8).
• Open Preferences, modify the structural models representation (Rendering > Structural models): set the atom radius to 3Å.
• Colorize each group of chains: double-click on the group and colorize it with a constant color.
• Ambient occlusion: enable object-space ambient occlusion with the default parameters.
• Anti-aliasing: enable with multisampling factor set to 2, enable FXAA.
• Background: white.
• Fog: disable.
• Lightning: the light intensity for first and second lights is set to zero; the ambient light is set to 1 and the Fresnel intensity is set to 0.
• Shadows: enable with the default parameters.
• Silhouettes: enable, set the silhouette opacity to 60%, the silhouette thickness to 1, and the distance threshold to 2Å.

## DNA polymerase with DNA

Let's make the following image of the molecule with PDB code 4QWE (DNA polymerase in complex with DNA).

4QWE

You can reproduce this image via the following steps:

• In the document view, expand the molecule to see chains. Select the chain A and apply the Ribbons (secondary structure) visual model ( Ctrl/ Cmd⌘ + Shift + V), and then hide the selected chain.
• Find all Sulfur and Calcium atoms. Open the Find window (Selection menu > Find or Ctrl/ Cmd⌘ + F). Input atom.symbol S or atom.symbol Ca (short version: a.s S or a.s Ca) and click Enter. Now you should see 11 nodes selected, press Ctrl/ Cmd⌘ + Shift + V and add Van der Waals visual model. Select in the document view the newly created Van der Waals visual model and in the Inspector (click Ctrl/ Cmd⌘ + I if you do not see the Inspector) set the scale to 0.75.
• In the document view, select the chains C and D and apply to them the Licorice visual model.
• Ambient occlusion: disable.
• Anti-aliasing: enable with multisampling factor set to 2, enable FXAA.
• Background: white.
• Fog: enable with the far distance set to 50Å.
• Lightning: default parameters.
• Shadows: enable with the default parameters.
• Silhouettes: enable and set the silhouette opacity to 50%.

## The human erythrocyte catalase

Let's make the following image of the molecule with PDB code 1DGF (the human erythrocyte catalase).

1DGF

You can reproduce this image via the following steps:

• Add the Ribbons (secondary structure) visual model ( Ctrl/ Cmd⌘ + Shift + V).
• Let's now hide all residues and water atoms, leaving shown only ACT, HEM, and NDP structural groups. Open the Find window (Selection menu > Find or Ctrl/ Cmd⌘ + F). First we will hide all non structural groups: input n.t structuralGroup (short version: n.t sg) and click Enter, then right-click on any selected node, and choose Invert selection in the context menu, right-click again on any selected node and in the context menu choose Visibility > Hide selection. Let's now hide all water atoms: open the Find window, input a.water and click Enter, then right-click on any selected node and in the context menu choose Visibility > Hide selection.
• Open Preferences, modify the structural models representation (Rendering > Structural models): set atom and bond radius to 0.3Å.
• In the document view, select the Ribbons (secondary structure) visual model and colorize it with a constant color (white).
• Let's colorize HEM and NDP structural groups. In the document view, enter HEM in the Filter nodes... and click Enter. Colorize it with constant color: right-click on any selected node and in the context menu choose Set color > Constant. Do the same for the NDP structural groups.
• Ambient occlusion: disable.
• Anti-aliasing: enable with multisampling factor set to 2, enable FXAA.
• Background: white.
• Fog: enable with the far distance set to 50Å.
• Lightning: default parameters.
• Shadows: enable with the default parameters.
• Silhouettes: enable and set the silhouette opacity to 50%.
• Orient the molecule in the viewport.

See also: Color schemes See also: Visual models See also: Visual presets See also: Presenting and animating