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))
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.12.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| protlabel-4.12.1.tar.gz | 16.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| protlabel-4.12.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.7 kB
Release files / protlabel-4.12.1.tar.gz
| Download URL | protlabel-4.12.1.tar.gz |
|---|---|
| Size | 16.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7256a359bdc9ad69257318ecc7887e93a9db8eca86de1351060eaa29df684156
|
|
BLAKE2b-256 checksum How to use checksums |
61a3f2338d04fcca19086d25cae3366f3045522e9656be4c19595a8c108a1b6d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 15, 2026.
Transparency logRelease files / protlabel-4.12.1-py3-none-any.whl
| Download URL | protlabel-4.12.1-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5846325289576be93a34d4c6432a12fdeb0851c35074d8eebbb995e5ac1c679f
|
|
BLAKE2b-256 checksum How to use checksums |
8aacb5d3fa6f478ca897832fe6fb8f0de730aad745a26453b32bd54aebc2547a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 15, 2026.
Transparency log