Skip to main content

Lightweight molecular structure viewer for Jupyter notebooks using py3Dmol

Project description

Ruff ty Tests License: MIT Python 3.11+ PyPI version

atomview

A lightweight, standalone molecular structure viewer for Jupyter notebooks. Visualize biotite AtomArray structures interactively using py3Dmol (3Dmol.js) — with chain-coloured cartoons, ligand sticks, ion spheres, surfaces, and hover labels out of the box.

atomview extracts and refactors the excellent view() function from atomworks (atomworks.io.utils.visualize) into a focused, minimal package. If all you need is a quick way to render structures in a notebook, you no longer have to pull in atomworks and its full dependency tree (RDKit, ML tooling, dataset infrastructure, etc.).

Installation

pip install atomview

Or with uv:

uv add atomview

Quickstart

# from urllib.request import urlretrieve
# urlretrieve("https://files.rcsb.org/download/4HHB.cif", "4hhb.cif")

from atomview import load_structure, view

structure = load_structure("4hhb.cif")

view(structure)

Gallery

Default protein view Surface overlay
Chain-coloured cartoon rendering of hemoglobin Hemoglobin with translucent molecular surface
One-line rendering with automatic chain colouring. Optional translucent VDW surface for shape context.
Ligand focus Mixed complex
4TOS protein-ligand rendering with ligand sticks 2CV5 protein-DNA complex rendering
Zoom to a ligand or binding-site selection. Proteins, nucleic acids, ligands, and ions styled together.

API

view()

The main entry point. Returns a py3Dmol.view object that renders inline in Jupyter.

from atomview import view

v = view(
    structure,
    show_cartoon=True,            # cartoon for polymers
    show_surface=False,           # VDW surface overlay
    show_hover=True,              # hover labels
    hide_solvent=True,            # remove water
    hide_crystallization_aids=True,
    zoom_to_selection=None,       # e.g. {"chain": "A", "resi": 35}
    width=600,
    height=400,
    colors=None,                  # custom colour list, or use defaults
)

Why not just use atomworks?

atomworks is a fantastic, comprehensive framework for biomolecular modelling maintained by RosettaCommons. But it's a big library — it bundles I/O, transforms, ML dataset tooling, RDKit integration, and more. If you just want to call view(structure) in a notebook, that's a lot of overhead.

atomview gives you exactly that one thing: a great molecular viewer with sensible defaults, in a package that installs in seconds.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

atomview-0.0.1.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

atomview-0.0.1-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file atomview-0.0.1.tar.gz.

File metadata

  • Download URL: atomview-0.0.1.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for atomview-0.0.1.tar.gz
Algorithm Hash digest
SHA256 9b65b634f95888fe4ba4fbda2d59b16039a5da00130065d1fb24bebad2b0851f
MD5 cb8b890e0004df72415350fcc05d45c2
BLAKE2b-256 3c6d9b5d4649e851b9ce2c3173d63f6508c1c4c52cdf05da4e2ee5aa8a7df2a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for atomview-0.0.1.tar.gz:

Publisher: deploy.yml on cch1999/atomview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file atomview-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: atomview-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for atomview-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 192a920e17d6975d029af0a4c6390b1c352fc85912f348ed6fde4eebdb228fc6
MD5 91608f3938054653d7906db71b11834c
BLAKE2b-256 5d2b4bae67bbc3bcc452564a20827620b934158131e3236c0de3d239c85a8746

See more details on using hashes here.

Provenance

The following attestation bundles were made for atomview-0.0.1-py3-none-any.whl:

Publisher: deploy.yml on cch1999/atomview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page