Skip to main content

A visualisation tool for protein embeddings from pLMs

Project description

ProtSpace

ProtSpace is a visualization tool for exploring protein embeddings or similarity matrix along their 3D protein structures. It allows users to interactively visualize high-dimensional protein language model data in 2D or 3D space, color-code proteins based on various features, and view protein structures when available.

Web Interface

Try ProtSpace directly in your browser without installation: https://protspace.rostlab.org/

Quick Start with Google Colab

Try ProtSpace instantly using our Google Colab notebooks:

Note: Some Google Colab functionalities may not work properly in Safari browsers. For the best experience, we recommend using Chrome or Firefox.

  1. Explore Pre-computed Visualizations: Open Explorer In Colab

  2. Generate Protein Embeddings: Open Embeddings In Colab

  3. Full Pipeline Demo: Open Pipeline In Colab

Table of Contents

Example Outputs

2D Scatter Plot (SVG)

2D Scatter Plot Example

3D Interactive Plot

View 3D Interactive Plot

Installation

pip install protspace

Usage

Data Preparation

protspace-json -i embeddings.h5 -m features.csv -o output.json --methods pca3 umap2 tsne2

Running protspace

protspace --json output.json [--pdb_zip pdb_files.zip] [--port 8050]

Access the interface at http://localhost:8050

Features

  • Interactive 2D/3D visualization with multiple dimensionality reduction methods:
    • Principal Component Analysis (PCA)
    • Multidimensional Scaling (MDS)
    • Uniform Manifold Approximation and Projection (UMAP)
    • t-Distributed Stochastic Neighbor Embedding (t-SNE)
    • Pairwise Controlled Manifold Approximation (PaCMAP)
  • Feature-based coloring and marker styling
  • Protein structure visualization (with PDB files)
  • Search and highlight functionality
  • High-quality plot exports (SVG for 2D, interactive HTML for 3D)
  • Responsive web interface

Data Preparation

The protspace-json command supports:

Required Arguments

  • -i, --input: HDF file (.h5) or similarity matrix (.csv)
  • -m, --metadata: CSV file with features (first column must be named "identifier" and match IDs in HDF5/similarity matrix)
  • -o, --output: Output JSON path
  • --methods: Reduction methods (e.g., pca2, tsne3, umap2, pacmap2, mds2)

Optional Arguments

  • --delimiter: Specify delimiter for metadata file (default: comma)
  • --custom_names: Custom projection names (e.g., pca2=PCA_2D)
  • --verbose: Increase output verbosity

Method-Specific Parameters

  • UMAP:
    • --n_neighbors: Number of neighbors (default: 15)
    • --min_dist: Minimum distance (default: 0.1)
  • t-SNE:
    • --perplexity: Perplexity value (default: 30)
    • --learning_rate: Learning rate (default: 200)
  • PaCMAP:
    • --mn_ratio: MN ratio (default: 0.5)
    • --fp_ratio: FP ratio (default: 2.0)
  • MDS:
    • --n_init: Number of initializations (default: 4)
    • --max_iter: Maximum iterations (default: 300)
    • --eps: Convergence tolerance (default: 1e-3)

Custom Feature Styling

Use protspace-feature-colors to customize feature appearance:

protspace-feature-colors input.json output.json --feature_styles '{
  "feature_name": {
    "colors": {
      "value1": "#FF0000",
      "value2": "#00FF00"
    },
    "shapes": {
      "value1": "circle",
      "value2": "square"
    }
  }
}'

Available shapes: circle, circle-open, cross, diamond, diamond-open, square, square-open, x

File Formats

Input

  1. Embeddings/Similarity
  • HDF5 (.h5) for embeddings
  • CSV for similarity matrix
  1. Metadata
  • CSV with mandatory 'identifier' column matching IDs in embeddings/similarity data
  • Additional columns for features
  1. Structures
  • ZIP containing PDB/CIF files
  • Filenames match identifiers (dots replaced with underscores)

Output

  • JSON containing:
    • Protein features
    • Projection coordinates
    • Visualization state (colors, shapes)

Citation

If you use ProtSpace in your research, please cite:

@article{SENONER2025168940,
title = {ProtSpace: A Tool for Visualizing Protein Space},
journal = {Journal of Molecular Biology},
pages = {168940},
year = {2025},
issn = {0022-2836},
doi = {https://doi.org/10.1016/j.jmb.2025.168940},
url = {https://www.sciencedirect.com/science/article/pii/S0022283625000063},
author = {Tobias Senoner and Tobias Olenyi and Michael Heinzinger and Anton Spannagl and George Bouras and Burkhard Rost and Ivan Koludarov}
}

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

protspace-1.1.6.tar.gz (99.1 MB view details)

Uploaded Source

Built Distribution

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

protspace-1.1.6-py3-none-any.whl (2.2 MB view details)

Uploaded Python 3

File details

Details for the file protspace-1.1.6.tar.gz.

File metadata

  • Download URL: protspace-1.1.6.tar.gz
  • Upload date:
  • Size: 99.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for protspace-1.1.6.tar.gz
Algorithm Hash digest
SHA256 73119c50ec33dc0a2e687ce72f1b8341a1140cded68dc3f8a7e73f89814fb5ed
MD5 d532f3e38517c8a06ebd5c48577fc979
BLAKE2b-256 c3e60d4b9ea02807a66f99343ef414775fbc59b81bc6ed78d98c3b20d4465cd7

See more details on using hashes here.

Provenance

The following attestation bundles were made for protspace-1.1.6.tar.gz:

Publisher: python.yml on tsenoner/protspace

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

File details

Details for the file protspace-1.1.6-py3-none-any.whl.

File metadata

  • Download URL: protspace-1.1.6-py3-none-any.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for protspace-1.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 acdcc8df32df4d206ca24b62314054c292e8170f2e864435f3cc8c68e4aea483
MD5 15e536e6d50c8c02f259cb00b7fc401f
BLAKE2b-256 671f353167f827028e2456d75087ddb8a7347b313fb0220afe3da800c6c3d39e

See more details on using hashes here.

Provenance

The following attestation bundles were made for protspace-1.1.6-py3-none-any.whl:

Publisher: python.yml on tsenoner/protspace

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