Skip to main content

protlabel

Embedding Annotation Transfer (EAT) engine — nearest-neighbour label transfer in protein-language-model (pLM) embedding space, with the goPredSim reliability index.

protlabel is a small, dependency-light library (numpy only). It is ProtSpace-agnostic by design — it imports nothing from protspace — so it is independently testable and reusable from notebooks, protspace_uniprot, or any other project. The protspace transfer CLI is a thin consumer of this engine.

Install

pip install protlabel

Use

import numpy as np
from protlabel import eat, Lookup

preds = eat(
    query_emb=np.random.rand(3, 1024).astype("float32"),
    query_ids=["Q1", "Q2", "Q3"],
    ref_emb=np.random.rand(100, 1024).astype("float32"),
    ref_ids=[f"R{i}" for i in range(100)],
    ref_labels=["toxin", "enzyme"] * 50,
    k=1,
    metric="cosine",          # or "euclidean" (the goPredSim default)
)
for p in preds:
    print(p.query_id, p.label, round(p.reliability, 3))

Pass keep_neighbors=True to also get, on each prediction, the k references it was computed from (p.neighbors: reference id, label and raw distance, nearest first).

Lookup builds and serialises a reusable reference set (.npz sidecar) so the reference matrix can be rebuilt on demand rather than shipped.

Method

Nearest-neighbour transfer in the original pLM embedding space (not a 2-D/3-D projection), with the goPredSim reliability index — see Littmann et al., Sci Rep 2021 (Eq. 5) and Heinzinger et al., NAR Genom Bioinform 2022.

Distances are computed with an exact, chunked brute-force search (numpy BLAS GEMM

  • argpartition); queries are processed in batches. No approximate-nearest-neighbour index is needed at Swiss-Prot scale.

License

MIT — part of the ProtSpace project.

Metadata

Release files for protlabel 4.17.1

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

Source distribution (sdist)

Source distribution for protlabel 4.17.1
File Size Uploaded Provenance Actions
protlabel-4.17.1.tar.gz 17.2 kB With provenance Details for protlabel-4.17.1.tar.gz

Built distribution (wheel)

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

Total release size: 27.9 kB

Release files / protlabel-4.17.1.tar.gz

Download URL protlabel-4.17.1.tar.gz
Size 17.2 kB
Tags Source
SHA-256 checksum
How to use checksums
61a225c7e54210a19a4a2fbe39a2b83cdfa0d6e4751d1bc9139dc7325796fddc
BLAKE2b-256 checksum
How to use checksums
fd8b6e8ee1436306e589be9b7e56964fb0db69336eaff6e5381c0a6d08e1ab65
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 Oct 27, 2026.

Transparency log

Release files / protlabel-4.17.1-py3-none-any.whl

Download URL protlabel-4.17.1-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c080d63c53a85cb487d63a89a17420406701e78f5b96bc071947b7b90588f8d7
BLAKE2b-256 checksum
How to use checksums
eb597285f680dc4253097f9ccf2e2da7a760e3325defb8d623e5be45fcca618a
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 Oct 27, 2026.

Transparency log

Security for protlabel 4.17.1

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 protlabel-4.17.1.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 Oct 27, 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.17.1 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