Skip to main content

ProtSpace

PyPI version Python 3.12+ License: MIT Downloads DOI (preprint) DOI (JMB)

ProtSpace maps the embedding space of protein language models (pLMs) to reveal relationships that sequence similarity misses. This Python package prepares your data — embed sequences, project to 2D, overlay biological annotations (UniProt, InterPro, AlphaFold/TED, ML predictions), and transfer labels from the nearest neighbour in embedding space (EAT) — then bundles everything into a .parquetbundle you explore interactively at protspace.app, nothing uploaded. Similarity matrices are supported as input too.

  • Multiple projections: linear and non-linear dimensionality reduction (PCA, UMAP, t-SNE, and more)
  • Automatic annotations: UniProt, InterPro, Taxonomy, TED domains, and Biocentral predictions
  • Quality metrics (opt-in): annotation-based cluster-validity + faithfulness (local & global) via --stats
  • Annotation transfer (EAT): fill missing annotations from the nearest reference proteins in embedding space via protspace transfer
  • Structure viewer: Integrated protein structure visualization
  • Export: PNG, PDF, SVG, HTML

🌐 Try Online

ProtSpace web app: fast 2D explorer optimized for large datasets — drag & drop the .parquetbundle this package produces and it is parsed in your browser, nothing uploaded. Small FASTA files can also be dropped directly and prepared for you. Source lives in the same repo under apps/web/.

🚀 Google Colab Notebooks

Note: Use Chrome or Firefox for best experience.

  1. Generate Protein Embeddings (FASTA → .h5, per protein or per residue; ProtT5, ProstT5, Ankh, ESM2, ESM C; useful on its own too): Open Embeddings In Colab

  2. Prepare ProtSpace Bundle: Open Preparation In Colab

  3. Transfer Annotations (EAT): Open Transfer In Colab

📦 Installation

pip install protspace

Optional extras

Extra Install Needed for
local pip install "protspace[local]" on-device embedding (--backend local) instead of the Biocentral API
similarity pip install "protspace[similarity]" MMseqs2 sequence-similarity projections (-s/--similarity)
frontend pip install "protspace[frontend]" the local Dash viewer (protspace serve, deprecated)

Upgrading an existing install: -s/--similarity used to work out of the box because MMseqs2 shipped in the base install. It now lives in the similarity extra, so add pip install "protspace[similarity]" if you use that flag. Nothing else changes: the base install got smaller, and on macOS and Linux the extra installs from a prebuilt wheel rather than compiling from source.

🎯 Quick Start

1. Prepare data

# From HDF5 embeddings
protspace prepare -i embeddings.h5 -m pca2,umap2 -o output

# From FASTA (auto-embeds via Biocentral API)
protspace prepare -i sequences.fasta -e prot_t5 -m pca2 -o output

# Multi-model comparison (compare across pLMs)
protspace prepare -i sequences.fasta -e prot_t5,esm2_650m,ankh_base -m pca2,umap2 -o output

# Combine datasets (same embedding name → proteins are unioned)
protspace prepare -i species_a.h5:prot_t5 -i species_b.h5:prot_t5 -m umap2 -o output

2. Explore results

Open the generated .parquetbundle at protspace.app/explore — it is read locally in your browser.

3. Power-user workflow (individual steps)

protspace embed -i sequences.fasta -e prot_t5 -e esm2_3b -o embeddings/
protspace project -i embeddings/prot_t5.h5 -i embeddings/esm2_3b.h5 -m pca2,umap2 -o projections/
protspace annotate -i embeddings/prot_t5.h5 -a default -o annotations.parquet
protspace stats -i embeddings/prot_t5.h5 -p projections/ -o statistics.parquet   # optional: quality metrics
protspace bundle -p projections/ -a annotations.parquet -s statistics.parquet -o output.parquetbundle
protspace transfer -b output.parquetbundle -e embeddings/prot_t5.h5 -t superfamily -o transferred.parquetbundle   # optional: fill gaps via EAT

Or compute quality metrics inline during prepare with --stats (opt-in): annotation-based cluster-validity + faithfulness per projection. See the CLI Reference.

Fill missing annotation values from the nearest annotated protein in embedding space with protspace transfer — Embedding Annotation Transfer (EAT). --report predictions.tsv lists each query's nearest references with their distances, and --max-distance auto marks each query near or distant from the references. protspace export output.parquetbundle output.tsv writes a bundle as one table, one row per protein.

Bundles in the older v1/v2 format still open, but that support ends in protspace 5.0.0. Upgrade them with protspace convert old.parquetbundle new.parquetbundle (or --in-place).

📊 Example Output

2D Example

✨ Annotations

Use -a to color-code proteins by UniProt, InterPro, Taxonomy, TED domain, and Biocentral prediction annotations. Groups (default, all, uniprot, interpro, taxonomy, ted, biocentral) and individual names can be mixed freely. If -a is omitted, the default group is used.

protspace prepare -i data.h5 -m pca2                              # default annotations
protspace prepare -i data.h5 -a default,interpro,kingdom -m pca2  # mix groups + individual

📖 Documentation

Full documentation lives at protspace.app/docs:

🧩 Where this fits

protspace is the data-preparation half of ProtSpace. It lives in the protspace monorepo alongside the web explorer:

Piece What it does
protspace (this package, apps/protspace/) Embed, project, annotate, bundle — produces .parquetbundle
Web explorer (apps/web/) Opens a .parquetbundle at protspace.app/explore

Issues and pull requests for both go to github.com/tsenoner/protspace.

📝 Citation

If you use ProtSpace, please cite the web application preprint (latest):

Senoner T, Vahidi P, Olenyi T, Senoner F, Sisman G, Kahl E, Rost B, Koludarov I. ProtSpace: Protein Universe in Your Browser. bioRxiv, 2026. doi:10.64898/2026.05.04.722720

The original, peer-reviewed ProtSpace publication:

Senoner T, Olenyi T, Heinzinger M, Spannagl A, Bouras G, Rost B, Koludarov I. ProtSpace: A Tool for Visualizing Protein Space. Journal of Molecular Biology, 437(15), 168940, 2025. doi:10.1016/j.jmb.2025.168940

Metadata

Release files for protspace 4.20.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for protspace 4.20.0
File Size Uploaded Provenance Actions
protspace-4.20.0.tar.gz 13.6 MB With provenance Details for protspace-4.20.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for protspace 4.20.0
File Interpreter ABI Platform Actions
protspace-4.20.0-py3-none-any.whl Python 3 none any Details for protspace-4.20.0-py3-none-any.whl

Total release size: 14.5 MB

Release files / protspace-4.20.0.tar.gz

Download URL protspace-4.20.0.tar.gz
Size 13.6 MB
Tags Source
SHA-256 checksum
How to use checksums
7974d016045ac2e17e98c5a077e4c61859bb67b9128dff46217b66948bc3149c
BLAKE2b-256 checksum
How to use checksums
79fc11f0e1ac978e529203d9f4aa2f034f4ed19d1d798af9c23abd765a47cbc3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / protspace-4.20.0-py3-none-any.whl

Download URL protspace-4.20.0-py3-none-any.whl
Size 876.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bfd7958ad64788463357f8752a5421fffc9abfa2506c4629d1dde5957af77852
BLAKE2b-256 checksum
How to use checksums
cbf885821ca3bd096270ed01046b0ee0fa98beab7dfb060bfa139910393e3e9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Security for protspace 4.20.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for protspace-4.20.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

4.20.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page