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))

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.10.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.10.1
File Size Uploaded
protlabel-4.10.1.tar.gz 16.5 kB Details

Built distribution (wheel)

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

Total release size: 26.8 kB

Release files / protlabel-4.10.1.tar.gz

Download URL protlabel-4.10.1.tar.gz
Size 16.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5ea2796c3b2ee9c7c4091e46d8413249aa3ccaf2c98bd74534bee911828c52a2
BLAKE2b-256 checksum
How to use checksums
ee073b365154f0cc4237273a3638f7a6de211d384e174c407804ff2b583328c7
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 Aug 7, 2026.

Transparency log

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

Download URL protlabel-4.10.1-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a3eecfa608fc075f471593d5dbf2cfa99c8b039a25af89fd0f32a3fed0c0d9e6
BLAKE2b-256 checksum
How to use checksums
b685de0c5848835361636e36367ebd4ca5548d099fbc3e4906fd99e79c1ad14a
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 Aug 7, 2026.

Transparency log

Release history Release notifications | RSS feed

4.16.7

2 release files

4.16.6

2 release files

4.16.5

2 release files

4.16.4

2 release files

4.16.3

2 release files

4.15.0

2 release files

4.14.0

2 release files

4.13.1

2 release files

4.13.0

2 release files

4.12.2

2 release files

4.12.1

2 release files

4.12.0

2 release files

4.11.3

2 release files

4.11.2

2 release files

4.11.1

2 release files

4.11.0

2 release files

4.10.3

2 release files

4.10.2

2 release files

This release

4.10.1 This release

2 release files

4.9.1

2 release files

4.9.0

2 release files

4.8.2

2 release files

4.8.1

2 release files

4.8.0

2 release files

4.7.2

2 release files

4.7.1

2 release files

4.7.0

2 release files

4.6.0

2 release files

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