Skip to main content

Terminal protein structure viewer

Project description

ProteinView

License: MIT Rust Build PRs Welcome

╔════════════════════════════════════════════════════════════════╗
║                                                                ║
║    ██████╗ ██████╗  ██████╗ ████████╗███████╗██╗███╗   ██╗     ║
║    ██╔══██╗██╔══██╗██╔═══██╗╚══██╔══╝██╔════╝██║████╗  ██║     ║
║    ██████╔╝██████╔╝██║   ██║   ██║   █████╗  ██║██╔██╗ ██║     ║
║    ██╔═══╝ ██╔══██╗██║   ██║   ██║   ██╔══╝  ██║██║╚██╗██║     ║
║    ██║     ██║  ██║╚██████╔╝   ██║   ███████╗██║██║ ╚████║     ║
║    ╚═╝     ╚═╝  ╚═╝ ╚═════╝    ╚═╝   ╚══════╝╚═╝╚═╝  ╚═══╝     ║
║                 ██╗   ██╗██╗███████╗██╗    ██╗                 ║
║                 ██║   ██║██║██╔════╝██║    ██║                 ║
║                 ██║   ██║██║█████╗  ██║ █╗ ██║                 ║
║                 ╚██╗ ██╔╝██║██╔══╝  ██║███╗██║                 ║
║                  ╚████╔╝ ██║███████╗╚███╔███╔╝                 ║
║                   ╚═══╝  ╚═╝╚══════╝ ╚══╝╚══╝                  ║
║                                                                ║
║   (=(    )=)~~(=(    )=)~~(=(    )=)~~(=(    )=)~~(=(    )=)   ║
║                                                                ║
╚════════════════════════════════════════════════════════════════╝

Terminal protein structure viewer -- load, rotate, and explore PDB/CIF structures right in your terminal.

Demo

Cartoon ribbon rendering of antibody-antigen complex (1ZVH)

Features

  • Braille character rendering -- high-resolution colored Unicode braille (2x4 dots per cell), works everywhere including SSH
  • HD pixel rendering -- Sixel/Kitty/iTerm2 graphics protocol support via ratatui-image for pixel-perfect display (--hd)
  • Cartoon ribbon visualization -- smooth ribbon/tube rendering with depth fog and Lambert shading for helices, beta-sheets, and coils
  • 3 visualization modes -- Cartoon (ribbon), Backbone (CA trace), Wireframe (all-atom bonds)
  • 5 color schemes -- secondary structure, chain, element, B-factor, rainbow
  • Interactive rotation, zoom, pan -- vim-style keybindings with auto-rotation
  • Protein-protein interface analysis -- detect and highlight inter-chain contacts
  • PDB and mmCIF format support -- including secondary structure parsing from both formats
  • Fetch from RCSB PDB -- download structures by ID with --fetch (optional feature)
  • Single static binary, zero runtime dependencies

Installation

# Basic install
cargo install --path .

# With RCSB PDB fetch support
cargo install --path . --features fetch

This builds the binary and places it in ~/.cargo/bin/, which is already on your PATH if you installed Rust via rustup. Then run proteinview from anywhere.

Usage

# View a local PDB file
proteinview examples/1UBQ.pdb

# HD pixel mode (Sixel/Kitty/iTerm2 terminals)
proteinview examples/4HHB.pdb --hd

# Choose color scheme
proteinview examples/1UBQ.pdb --color rainbow

# Choose visualization mode
proteinview examples/4HHB.pdb --mode wireframe

# Fetch from RCSB PDB (requires --features fetch)
proteinview --fetch 1UBQ

Keybindings

Key Action
h / l Rotate Y-axis
j / k Rotate X-axis
u / i Rotate Z-axis (roll)
+ / - Zoom in / out
w/a/s/d Pan
r Reset view
c Cycle color scheme
v Cycle visualization mode
f Toggle interface analysis
m Toggle braille / HD
[ / ] Previous / next chain
Space Toggle auto-rotation
? Help overlay
q Quit

Visualization Modes

Mode Description
Cartoon Ribbon rendering with smooth helices, beta-sheet arrows, and coil tubes. Default.
Backbone CA-trace with spheres at alpha-carbon positions connected by thick lines.
Wireframe All-atom display showing every bond in the structure.

Wireframe view of hemoglobin (4HHB) with chain coloring

Color Schemes

Scheme Description
Secondary Structure Helix (red), sheet (yellow), coil (green), turn (blue). Default.
Chain Each chain gets a distinct color from a curated palette.
Element (CPK) Atoms colored by element: C gray, N blue, O red, S yellow.
B-factor Blue (low mobility) to red (high mobility) gradient.
Rainbow N-terminus (blue) to C-terminus (red) by residue position.

Example PDB Files

File Description
examples/1UBQ.pdb Ubiquitin -- 76 residues, single chain, classic test protein
examples/4HHB.pdb Hemoglobin -- 4 chains, 574 residues, good for multi-chain viewing
examples/1ZVH.cif Antibody-antigen complex -- mmCIF format, good for interface analysis

Interface Analysis

Press f to toggle the protein-protein interface panel, which detects inter-chain contacts and highlights interface residues.

Interface analysis panel showing chain contacts

Terminal Support

  • Works in any terminal with Unicode support (braille mode).
  • For best quality, use a terminal with Sixel or Kitty graphics protocol support (e.g., WezTerm, Kitty, foot, iTerm2) and pass --hd.
  • The --hd flag auto-detects the best graphics protocol; falls back to colored braille if none available.

Building

cargo build --release

# With RCSB fetch support:
cargo build --release --features fetch

Contributing

Contributions welcome! Please open an issue or PR on GitHub.

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

proteinview-0.1.0.tar.gz (5.9 MB view details)

Uploaded Source

Built Distribution

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

proteinview-0.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (975.6 kB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

File details

Details for the file proteinview-0.1.0.tar.gz.

File metadata

  • Download URL: proteinview-0.1.0.tar.gz
  • Upload date:
  • Size: 5.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for proteinview-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3aed184dc5aa9088accc3c2d9128ae502f1ef51b678d7945c9451752a09ed390
MD5 ad6d2e8ee3af1f26d2017de8b1319e86
BLAKE2b-256 672aa7aec0136d1f73ae2eb5ab8edbdd9f9da8122291bd361d90b905ca80530b

See more details on using hashes here.

Provenance

The following attestation bundles were made for proteinview-0.1.0.tar.gz:

Publisher: workflow.yml on Desperadus/ProteinView

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

File details

Details for the file proteinview-0.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for proteinview-0.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d33b617a78f8ec03ba23506b042430cf95be6c0eb8d1bf182d1b1bafe92503a2
MD5 86e7219fde1d553754c8bc707c221a15
BLAKE2b-256 e3b2e794251f69c732be2d1a9eb87bd5f90611d0452387b5c6ad00c9c4a33c9b

See more details on using hashes here.

Provenance

The following attestation bundles were made for proteinview-0.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: workflow.yml on Desperadus/ProteinView

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