Terminal protein structure viewer
Project description
ProteinView
╔════════════════════════════════════════════════════════════════╗
║ ║
║ ██████╗ ██████╗ ██████╗ ████████╗███████╗██╗███╗ ██╗ ║
║ ██╔══██╗██╔══██╗██╔═══██╗╚══██╔══╝██╔════╝██║████╗ ██║ ║
║ ██████╔╝██████╔╝██║ ██║ ██║ █████╗ ██║██╔██╗ ██║ ║
║ ██╔═══╝ ██╔══██╗██║ ██║ ██║ ██╔══╝ ██║██║╚██╗██║ ║
║ ██║ ██║ ██║╚██████╔╝ ██║ ███████╗██║██║ ╚████║ ║
║ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚══════╝╚═╝╚═╝ ╚═══╝ ║
║ ██╗ ██╗██╗███████╗██╗ ██╗ ║
║ ██║ ██║██║██╔════╝██║ ██║ ║
║ ██║ ██║██║█████╗ ██║ █╗ ██║ ║
║ ╚██╗ ██╔╝██║██╔══╝ ██║███╗██║ ║
║ ╚████╔╝ ██║███████╗╚███╔███╔╝ ║
║ ╚═══╝ ╚═╝╚══════╝ ╚══╝╚══╝ ║
║ ║
║ (=( )=)~~(=( )=)~~(=( )=)~~(=( )=)~~(=( )=) ║
║ ║
╚════════════════════════════════════════════════════════════════╝
Terminal protein structure viewer -- load, rotate, and explore PDB/CIF structures right in your terminal.
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)
- 6 color schemes -- secondary structure, pLDDT (when available), 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
Easy install via pip for x86 (for arm, it will try to build it on your machine using maturin)
pip install proteinview
or build it here from source
# 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
# Color AlphaFold / ModelCIF structures by pLDDT
proteinview examples/AF3_TNFa.pdb --color plddt
# 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. |
Color Schemes
| Scheme | Description |
|---|---|
| Secondary Structure | Helix (red), sheet (yellow), coil (green), turn (blue). Default. |
| pLDDT | AlphaFold confidence colors when the file stores pLDDT scores. |
| 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 |
examples/AF3_TNFa.pdb |
AlphaFold-style PDB with pLDDT confidence values |
examples/OBP5_model_0.cif |
ModelCIF example with pLDDT-style confidence values |
Interface Analysis
Press f to toggle the protein-protein interface panel, which detects inter-chain contacts and highlights interface residues.
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
--hdflag 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file proteinview-0.1.2.tar.gz.
File metadata
- Download URL: proteinview-0.1.2.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c20f54d5dc8fd8e9f5323002b776198afd00db055c9b379ab4105aad0b0193f
|
|
| MD5 |
24570a7d9297370c310e69ec1385a780
|
|
| BLAKE2b-256 |
e4364c3d8c53a359cc740e19241c8eea594423367b08e7e276c348368187ca1a
|
Provenance
The following attestation bundles were made for proteinview-0.1.2.tar.gz:
Publisher:
workflow.yml on Desperadus/ProteinView
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
proteinview-0.1.2.tar.gz -
Subject digest:
0c20f54d5dc8fd8e9f5323002b776198afd00db055c9b379ab4105aad0b0193f - Sigstore transparency entry: 1075989063
- Sigstore integration time:
-
Permalink:
Desperadus/ProteinView@cbc6277f36b319921954d523b3f395496ac789ca -
Branch / Tag:
refs/heads/master - Owner: https://github.com/Desperadus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@cbc6277f36b319921954d523b3f395496ac789ca -
Trigger Event:
push
-
Statement type:
File details
Details for the file proteinview-0.1.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: proteinview-0.1.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.0 MB
- Tags: Python 3, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61577a331b5bc5a2ec968fc233bc92694ba8d21b4da03336c11f8a62ffeb44af
|
|
| MD5 |
de35b4f0a293079ba2cead918e4cfb96
|
|
| BLAKE2b-256 |
5719e920339906ca75f667dd4130f5e310e07451f9c5e436ccc969c592e77c2d
|
Provenance
The following attestation bundles were made for proteinview-0.1.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
workflow.yml on Desperadus/ProteinView
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
proteinview-0.1.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
61577a331b5bc5a2ec968fc233bc92694ba8d21b4da03336c11f8a62ffeb44af - Sigstore transparency entry: 1075989078
- Sigstore integration time:
-
Permalink:
Desperadus/ProteinView@cbc6277f36b319921954d523b3f395496ac789ca -
Branch / Tag:
refs/heads/master - Owner: https://github.com/Desperadus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@cbc6277f36b319921954d523b3f395496ac789ca -
Trigger Event:
push
-
Statement type: