Examples

This page demonstrates various MolViewSpec examples showcasing different visualization capabilities using the builder API.

Basic Example

A simple molecular structure visualization. This example loads the 1cbs structure from the PDB and displays it as a blue cartoon representation.

Components Example

This example demonstrates multiple component selection with different representations. It shows an aminoacyl-tRNA synthetase (1c0a) with protein (orange), nucleic acid (blue), and specific residues highlighted in different colors. The example also demonstrates labels and focus functionality.

Label Example

This example demonstrates custom labeling on specific residues. It highlights residue ALA 120 A in red with a custom label and focuses the camera on it.

Superposition Example

This example demonstrates structural superposition by loading two hemoglobin structures (4hhb in red and 1oj6 in blue) and applying a transformation matrix to align them.

Symmetry Example

This example demonstrates crystal symmetry visualization by creating a 3x3x3 unit cell grid of structure 1tqn.

Annotations Example

This example demonstrates using external annotation files to define components, colors, labels, and tooltips. It loads structure 1h9t (protein-DNA complex) and applies annotations from a CIF file.

Primitives Example

This example demonstrates geometric primitives without molecular structures. It includes ellipses, arrows, and an ellipsoid with different opacities.

Volumes Example

This example demonstrates electron density map visualization. It loads structure 1tqn along with 2FO-FC and FO-FC electron density maps from the PDBe Volume Server.