Public API#

This section documents the supported, user-facing Python API.

Core entrypoints#

molsysviewer.MolSysView

Mol* viewer widget with a Python-facing API.

molsysviewer.new_view

Create and return a MolSysView, optionally loading a molecular system.

molsysviewer.demo

Dictionary-like access to built-in demo views.

MolSysView: query and live operations#

molsysviewer.MolSysView.select

Select indices from the current molecular system (MolSysMT selection language).

molsysviewer.MolSysView.get

Retrieve attribute values from the current molecular system (MolSysMT get).

molsysviewer.MolSysView.info

molsysviewer.MolSysView.append_structures

Append structures (frames) to the loaded system and refresh the viewer (live).

molsysviewer.MolSysView.set

Set attribute values on the loaded system and refresh the viewer (live).

molsysviewer.MolSysView.add

Add atoms/structures from another system into this view and refresh the viewer (live).

molsysviewer.MolSysView.remove

Remove atoms and/or structures from this view and refresh the viewer (live).

Version#

The installed package version is available as molsysviewer.__version__.

Configuration#

molsysviewer.config

User-facing configuration for MolSysViewer.

molsysviewer.config.show_controls

bool(x) -> bool

molsysviewer.config.autohide_controls

bool(x) -> bool

molsysviewer.config.controls_position

Built-in mutable sequence.

molsysviewer.config.controls_position_fullscreen

Built-in mutable sequence.

molsysviewer.config.load_user_presets

Load user presets from a JSON or YAML file into user_presets.

User presets registry#

molsysviewer.config.user_presets = {}#

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

Scene management#

molsysviewer.whole.Whole

Wrapper for operations on the whole structure (non-deletable, non-retaggable).

molsysviewer.regions.Region

Wrapper for a molecular region (Mol* component) addressed by tag.

molsysviewer.layers.Layer

Wrapper for a non-structural visual layer (shapes, overlays) addressed by tag.

Loaders#

molsysviewer.loaders

molsysviewer.loaders.load_from_molsysmt

Internal backend for MolSysView.load(...).

Shapes and overlays#

molsysviewer.shapes

molsysviewer.shapes.ShapesManager

Shape manager bound to a MolSysView.

molsysviewer.shapes.SphereShapes

Sphere helpers for the scene.

molsysviewer.shapes.PocketSurfaces

Helpers for pocket/void surfaces based on selected atoms.

molsysviewer.shapes.PocketBlobs

API for volumetric blobs (Gaussian fields) built from alpha-spheres.

molsysviewer.shapes.ChannelTubes

API to build channel tubes along ordered centers/radii (e.g., TopoMT routes).

molsysviewer.shapes.AnisotropyEllipsoids

Visualize oriented ellipsoids/disks from eigenvalues/eigenvectors or tensors.

molsysviewer.shapes.PharmacophoreShapes

API for pharmacophore glyphs (spheres/disks/arrows).

molsysviewer.shapes.LinkShapes

molsysviewer.shapes.DisplacementVectors

molsysviewer.shapes.TriangleFaces

molsysviewer.shapes.Tetrahedra

Documentation helpers#

molsysviewer.thirds.jupyter.load_html_in_notebook

Return an IFrame pointing to a pre-generated MolSysViewer HTML asset.