Using Google Colab
The easiest way to prepare your data for ProtSpace - no local installation required!
Overview
The Colab notebook converts protein embeddings into a visualization-ready .parquetbundle file:
- Reads your input: an example dataset, embeddings from an HDF5 file (.h5), sequences from a FASTA file (embedded for you), or a UniProt query
- Applies 2-D dimensionality reduction (PCA, UMAP, t-SNE, PaCMAP, MDS, LocalMAP)
- Retrieves annotations from UniProt, InterPro, Taxonomy, TED, and Biocentral
- Creates the
.parquetbundlefile ready for ProtSpace
Quickest path: drop a FASTA
If your ProtSpace deployment runs the prep backend, you can skip the notebook entirely: drag a .fasta / .fa / .fna file onto the Explore drop zone. The server embeds, projects, annotates, and bundles your sequences, and the visualization opens automatically.
Limits enforced on this path:
| Limit | Value |
|---|---|
| Sequences per file | 20 minimum, 1500 maximum |
| Residues per sequence | 2000 |
| Upload size | 8 MB |
| Job wall-clock time | 420 seconds (7 minutes) |
Behind the scenes the service runs the same CLI subcommands you would run yourself: protspace embed -e prot_t5 and protspace annotate -a default in parallel, then protspace project -m pca2,umap2, then protspace bundle. You get exactly the PCA_2 and UMAP_2 projections. Use the notebook or the CLI for any non-default configuration (different embedder, additional projections, other annotation sources).
TIP
FASTA headers are normalized before embedding, so sp|P12345|NAME_HUMAN becomes P12345.
Self-hosting
There is no feature flag or capability probe, the drop zone always posts to /api/prepare. To enable this path on your own deployment you must run the prep service and build the web app with VITE_PREP_API_BASE pointing at it. Without both, a FASTA drop fails with an upload error.
Unlike .parquetbundle loading, this path uploads your sequences to a server. See Importing Data for the full in-app flow, progress reporting, and error handling.
Step 1: Get Protein Embeddings
You need an HDF5 file (.h5) containing protein embeddings. There are three ways to obtain this:
Option A: Download from UniProt (Recommended)
- Go to uniprot.org
- Search for proteins using UniProt query syntax (e.g.,
(ft_domain:phosphatase) AND (reviewed:true)) - Click Download → Select Format Embeddings → Submit job
- Download the results - check UniProt's Tools Dashboard for the prepared embedding file
Option B: Generate from FASTA
Use the Embeddings notebook, a simple embedding tool in its own right:
It embeds a FASTA with ProtT5, ProstT5, Ankh, ESM2 or ESM C and writes an .h5 with one vector per protein (or per residue), named so ProtSpace recognises the model. Attach a GPU (Runtime → Change runtime type → T4 GPU), set the model and the FASTA in its one cell, and run it; it downloads the .h5 when done. Run it again after changing a setting: the model stays loaded, and proteins already in the file are skipped. ESM C 6B runs on the free T4: the weights load straight into GPU memory, and it takes about 5.5 minutes per 1,000 proteins after a 6-minute download and load. Without a GPU it needs a High-RAM runtime.
- No login and nothing to install for any of the models. ESM C runs on transformers' own port of the official weights (
biohub/ESMC-300M,-600M,-6B). ESM3 is no longer offered;.h5files the notebook wrote with it still load in ProtSpace asesm3_open. - Leave the FASTA path empty to try an example: 60 snake-venom proteins from Swiss-Prot (20 each of three-finger toxins, phospholipase A2 and Kunitz-type), fetched from UniProt. Tick its upload box for your own FASTA, or give a
/content/drive/...path to read it from Google Drive.
Option C: Use Your Own Embeddings
For advanced users with custom embeddings, save them as an HDF5 file where each protein is stored as a dataset named by its identifier.
You do not need to name the model behind any of these files. The notebook's Model choice defaults to Auto-detect, which reads the file's model_name attribute (the Embeddings notebook writes it), else a model key at the end of the file name (toxins_esm2_650m.h5 is esm2_650m), else the file name itself. The name labels the projections; pick the model by hand if the label comes out wrong. The same rules apply in the CLI.
Step 2: Run the Notebook
Click the Colab badge at the top of this page to open the notebook
Choose Runtime → Run all. Setup takes about 30 seconds, then the control panel appears. Run all never stops to ask for a file, and building the panel downloads nothing: the example dataset is fetched when you click Generate. Setup keeps the packages Colab has already loaded (numpy, pandas) at their versions, so it needs no restart. If one changed all the same, the setup cell stops and names it: choose Runtime → Restart session, then Run all again. The second run installs nothing and takes seconds
Get your file into the Colab runtime, if you use one, in any of three ways:
- Upload cell: tick the box in Optional: upload a file from your computer, run that cell and pick the file. It lands in a new
upload-…folder, so a corrected file uploaded under the same name is the one the panel loads, and its path fills the matching field in the panel. Untick it afterwards, or the next Run all asks for a file again - Files pane: drag the file into the folder icon in Colab's left sidebar; it lands in
/content/ - Google Drive: mount it from the Files pane and use the
/content/drive/MyDrive/...path
Large files are fine on all three routes. The panel itself never uploads an
.h5or FASTA through a widget, because widget uploads of about 10 MB and up fail without an error.- Upload cell: tick the box in Optional: upload a file from your computer, run that cell and pick the file. It lands in a new
In the panel's 1 · Input data section, open the tab you want:
- Example dataset: one of the pre-computed ProtT5 datasets. Its annotations come with it: every one you request that the example's ready-made bundle holds is taken from there instead of fetched (tick Fetch annotations again for current values)
- Embeddings (.h5): enter the file's path (it loads when you press Enter or click Load) and check the Ready line, which shows the protein count, the dimensions and the embedding name
- Sequences (FASTA): enter the path and click Load, then select the model(s) and the embedding backend below the tabs
- UniProt query: type a query and click Set query, then select the model(s)
No file at hand? The
.h5and FASTA tabs each have a Load an example button that puts an example file into the runtime and fills in its path: 536 three-finger toxins embedded with ProtT5, and 60 snake-venom proteins from Swiss-Prot. A FASTA's Ready line shows its first header and the protein ID read from it. The UniProt tab's Examples list fills in and sets a query.The line beside Generate says what it will run on. The panel keeps its settings in the runtime: after Runtime → Restart session, Run all brings back the last Generate's tab, paths, methods and annotation choices, then loads any file you uploaded after that Generate (with nothing generated yet, the newest upload of each kind). A Run all without a restart does the same.
Step 3: Configure Options
Annotations
Choose which annotations to include. They come from five sources: UniProt, InterPro, Taxonomy, TED, and Biocentral (predicted).
See the Annotations reference for the complete per-column catalogue: what each annotation means, where it comes from, and which ones are predicted.
To add your own columns, give a CSV or TSV (gzipped is fine) with the protein IDs in its first column, whatever that column is called (the full rules are under Custom annotation files): enter its path, or choose it with Choose CSV/TSV. Pick CSV only (no UniProt fetch) to use just those columns, for example when your IDs are not UniProt accessions. Its Load an example button fills in a CSV with a venom_family column for the FASTA tab's example proteins. When none of an .h5 file's IDs is a UniProt accession, the panel fetches nothing from UniProt anyway and uses the CSV alone (or makes a bundle without annotations), and says so. Tick Fetch annotations again to replace annotations an earlier run in this runtime fetched for the same proteins, instead of reusing them.
Dimensionality Reduction
Choose which 2-D projections to generate:
- PCA - Fast, initial overview
- UMAP - Best balance of speed and quality (recommended)
- t-SNE - Great for clusters, slower on large datasets
- PaCMAP - Alternative to t-SNE/UMAP
- MDS - Preserves pairwise distances
- LocalMAP - Local-first alternative to PaCMAP
Parameters (Optional)
Fine-tune settings for each method. The defaults are the CLI's, and each slider covers only the values the CLI accepts. t-SNE's perplexity must stay below the number of proteins (at most about a third of it is sensible). The Methods section says so as soon as the loaded input is too small for the value, and Generate does not start until it is changed:
| Method | Parameters |
|---|---|
| UMAP | N Neighbors, Min Dist, Metric |
| t-SNE | Perplexity, Learning Rate, Metric |
| PaCMAP | N Neighbors, MN Ratio, FP Ratio |
| MDS | None in the notebook; --n-init, --max-iter and --eps are CLI-only |
| LocalMAP | N Neighbors, MN Ratio, FP Ratio |
Quality statistics (Optional)
Tick Compute quality statistics to score how well your annotations separate, and how faithfully each projection preserves the original embedding. This is the notebook's equivalent of the CLI's --stats flag. It is off by default, and the cost grows with dataset size.
ProtSpace renders these scores in the legend and the projection metadata panel. See Separation Scores.
Step 4: Generate and Download
- Click Generate. It runs on the input tab that is open; if that tab has nothing loaded it says so and runs nothing. It first prints the input it runs on, with the protein count
- Wait for processing (time depends on dataset size). The button is disabled until the run ends. A bar and a status box below it show the step (for example Step 3 of 6 · Reducing dimensions (UMAP 2, 2 of 4)) and the time since the click, and protspace's own progress lines appear under that
- When it is done, the status box names the
.parquetbundle, its size and the time taken, and says the download has started. The browser saves the file when the transfer ends, which for a large bundle can be a while after Done. Download bundle downloads any bundle of this runtime again (its list shows each with its size and time), and the Colab Files pane has them underoutput/ - If a run fails, the status box names the step and the error, with the advice that fits it (restart the session for a package the install replaced, change a parameter, attach a GPU when Biocentral is down); the details for a bug report are printed below it
Optional: fill missing annotations (EAT)
The Preparation notebook has an Embedding Annotation Transfer panel below the Generate button. It fills blank annotation values on your query proteins from their nearest annotated neighbours in embedding space, with a reliability score attached. Its column list fills in after each Generate and offers only the columns with values to copy and gaps to fill, each with its counts (for example family (2,544 set / 2,491 missing)). A run shows its steps and elapsed time like Generate. Not sure what to fill in? On a bundle with UniProt annotations (the Snake Toxin example mixes both), Load example filters: Swiss-Prot → TrEMBL fills in protein_families, the query filter reviewed~TrEMBL and the reference filter reviewed~Swiss-Prot, so labels are copied only from reviewed entries.
A label is copied however far the nearest reference is, so the panel sets a distance cutoff, calibrated on the references by default (the CLI's --max-distance auto), and marks each query near or distant in a COL__neighbor column; the status box counts both and warns when most queries are distant. Tick Leave distant queries unpredicted to fill only the near ones. References from one family give every query that family, so check Download neighbour report: a TSV with each query's nearest references and their distances, the CLI's --report. On a protspace release without these options the panel says so and transfers without them. The Transfer notebook runs the same transfer on its own, using the protspace transfer CLI.
Transferred values get their own panel and their own marker style in the plot, so you can always tell them apart from curated ones. See Transferred Annotations (EAT).
Step 5: Visualize in ProtSpace
- Go to protspace.app/explore
- Drag & drop your
.parquetbundlefile onto the scatterplot - Start exploring!
Tips
- Start small: Test with a subset of proteins first.
- PCA is fastest: All methods except PCA become significantly slower with larger datasets (quadratic or worse complexity).
- Try multiple methods: For best results, include both PCA and UMAP.
Alternative: Python CLI
For local processing, automation, or larger datasets, see the Python CLI guide.