Embedding Annotation Transfer (EAT): nearest-neighbour label transfer in protein-language-model embedding space
Project description
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file protlabel-4.7.2.tar.gz.
File metadata
- Download URL: protlabel-4.7.2.tar.gz
- Upload date:
- Size: 16.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2cc177f44cc4b858986fd5981c7e495e4c55f08b155c6119f6bd88e1585d50d
|
|
| MD5 |
2ae510af693ae289be7686fb712f2ba2
|
|
| BLAKE2b-256 |
574477d98cb4b87ef6fa5ffd7ee64d08e71a0deb962447cb199160e262576bb0
|
Provenance
The following attestation bundles were made for protlabel-4.7.2.tar.gz:
Publisher:
protspace-publish.yml on tsenoner/protspace
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
protlabel-4.7.2.tar.gz -
Subject digest:
a2cc177f44cc4b858986fd5981c7e495e4c55f08b155c6119f6bd88e1585d50d - Sigstore transparency entry: 2168407074
- Sigstore integration time:
-
Permalink:
tsenoner/protspace@60f8d73435e08d840d08b5d7e5a141478272ae79 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/tsenoner
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
protspace-publish.yml@60f8d73435e08d840d08b5d7e5a141478272ae79 -
Trigger Event:
repository_dispatch
-
Statement type:
File details
Details for the file protlabel-4.7.2-py3-none-any.whl.
File metadata
- Download URL: protlabel-4.7.2-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bcc5ecf81ca12cd3b48b90e2b0d1ab3405e7deeec4979d026cf575f65c75d07f
|
|
| MD5 |
dce50b8560ccb1985e5e35e6acba285a
|
|
| BLAKE2b-256 |
51492aee0c3151a1349a44b7f6031f38dbf5f073e7268e2f9babc3e3647e9177
|
Provenance
The following attestation bundles were made for protlabel-4.7.2-py3-none-any.whl:
Publisher:
protspace-publish.yml on tsenoner/protspace
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
protlabel-4.7.2-py3-none-any.whl -
Subject digest:
bcc5ecf81ca12cd3b48b90e2b0d1ab3405e7deeec4979d026cf575f65c75d07f - Sigstore transparency entry: 2168407434
- Sigstore integration time:
-
Permalink:
tsenoner/protspace@60f8d73435e08d840d08b5d7e5a141478272ae79 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/tsenoner
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
protspace-publish.yml@60f8d73435e08d840d08b5d7e5a141478272ae79 -
Trigger Event:
repository_dispatch
-
Statement type: