Skip to main content

uupmap

uupmap reads UniWeave, a residue-level UniProt-to-UniProt mapping resource. Every edge links two UniProt accessions by sequence (MMseqs2) and/or structural (FoldSeek TM-align, ProstT5 3Di) similarity and carries the residue correspondence between them, so a residue index in one protein can be carried over to its counterpart in another.

This package is the reader only: it opens the published Parquet files and answers queries. It depends on Polars and nothing else; classifying AlphaFold-DB models yourself (below) also needs Biopython, through the align extra.

Install

pip install uupmap            # the reader
pip install "uupmap[align]"   # plus Biopython, for uupmap.frame_classify

Get the data

The artifacts are on Hugging Face (CC-BY-4.0). Each weekly release is tagged with its data_version, so a release can be pinned with revision=:

from pathlib import Path
from huggingface_hub import snapshot_download   # pip install huggingface_hub

d = Path(snapshot_download("UniWeave/uniweave", repo_type="dataset"))

The release is about 0.4 GB: edges.parquet, uniprots.parquet, sifts.parquet, model_frames.parquet, stats.json and dataset_manifest.json.

Query

from uupmap import UUPMap

m = UUPMap(d / "edges.parquet", d / "uniprots.parquet",
           model_frames_path=d / "model_frames.parquet")

# UniProt neighbours of a protein. Thresholds default to 1.0, so pass the ones you want.
for n in m.neighbors("P69905", seq_id_min=0.3, tm_min=0.5):
    print(n.unp_b, n.seq_identity, n.tm_score)

# Carry residue 87 of P69905 over to its neighbours.
for hit in m.expand_indices([("P69905", 87)], seq_id_min=0.3, tm_min=0.5):
    print(hit.unp_b, hit.idx_b, hit.cigar_source)

# Scores and channels behind one pair.
print(m.provenance("P69905", "P68871"))

neighbors and expand_indices accept min_cov, min_plddt, require_both (sequence and structure must both pass) and di_bits_per_res_min (admits ProstT5 3Di edges, off by default).

AlphaFold-DB residue numbering

Residue maps are in current UniProt numbering. An AlphaFold-DB model can be numbered against an older version of its UniProt entry; model_frames.parquet records the correspondence, and m.unp_to_model(acc, positions) / m.model_to_unp(acc, residues) translate lists of numbers between the two for tools that open the model files themselves (m.model_frame(acc) is None for an accession with no AFDB model checked). A frame describes one model file: before mapping through a model you downloaded yourself, check that uupmap.residue_frame.crc64(sequence) of its modelled sequence equals the frame's model_crc64.

When it does not (another model version, or an accession the release does not cover), uupmap.frame_classify classifies the model by the same rules UniWeave's build applies to write model_frames.parquet, from the modelled sequence and the current UniProt sequence:

from uupmap.frame_classify import build_frame_map

fmap = build_frame_map(model_sequence, uniprot_sequence)
print(fmap.kind, fmap.identity, fmap.model_coverage)   # identical | offset | aligned | unreliable
print(fmap.remap(15))                                  # model residue 15 -> UniProt position, or None

Identical and offset frames need nothing beyond the reader. The aligned case (about one model in a thousand) runs a Biopython alignment and needs uupmap[align].

Version contract

Each release states which readers can read it. From the releases that carry them, dataset_manifest.json has uupmap_version (the reader that built it), artifact_format and min_uupmap_version in its software block. The installed package exposes the matching constants:

import json, uupmap

software = json.loads((d / "dataset_manifest.json").read_text())["software"]
print(uupmap.__version__, uupmap.ARTIFACT_FORMAT, uupmap.MIN_READER_VERSION)
print(software.get("min_uupmap_version"), software.get("artifact_format"))

Below 0.0.2, a coverage floor silently dropped the structure-only edges, most of the graph. Use 0.0.2 or later.

Licence

The code is Apache-2.0 (see LICENSE and NOTICE). The UniWeave data is CC-BY-4.0. A preprint describing UniWeave is in preparation.

Metadata

Release files for uupmap 0.0.4

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

Source distribution (sdist)

Source distribution for uupmap 0.0.4
File Size Uploaded Provenance Actions
uupmap-0.0.4.tar.gz 41.7 kB With provenance Details for uupmap-0.0.4.tar.gz

Built distribution (wheel)

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

Total release size: 88.3 kB

Release files / uupmap-0.0.4.tar.gz

Download URL uupmap-0.0.4.tar.gz
Size 41.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5b7cf17b47763e4462cd38bdef4ac0fcf69454f0ad9419cc9f4bdb4abc0dfb9e
BLAKE2b-256 checksum
How to use checksums
24d200bac093b8a2fed29e17493cc3988c02fa2d35beda52974b5ba979133916
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 16, 2026.

Transparency log

Release files / uupmap-0.0.4-py3-none-any.whl

Download URL uupmap-0.0.4-py3-none-any.whl
Size 46.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
090d3e1364cec341323556004db61ea77ed70aeba4f56b325200af66e590b890
BLAKE2b-256 checksum
How to use checksums
e30043e56741f3840a6530ad46df530cba9d8165f26500e5a4165ae502e95463
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 16, 2026.

Transparency log

Security for uupmap 0.0.4

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 uupmap-0.0.4.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 16, 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.

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