A NumPy port of the NEAR code for embedding protein sequences.
Project description
🔭 mininear 
A NumPy port of the NEAR code for embedding protein sequences.
🗺️ Overview
NEAR (neural embeddings for amino acid relationships)
is a method developed by Daniel Olson et al.[1] to generate
meaningfull residue-level embeddings for proteins, which can then be used
for nearest-neighbor search in high-dimensional space.
mininear is a pure-Python package to encode protein sequences into NEAR
embeddings, using the trained weights from the NEAR ResNet, and a portable
re-implementation of ResNet using NumPy (and code derived from the
numpy-ml project).
This library only depends on NumPy and is available for all modern Python versions (3.7+).
🔧 Installing
Install the mininear package from GitHub, until a PyPI release is made
available:
$ pip install git+https://github.com/althonos/mininear
💡 Example
mininear provides a single Encoder class, which can be used to encode
a sequence using the NEAR ResNet:
import mininear
encoder = mininear.Encoder()
embedding = encoder.encode_sequence("MLELLPTAVEGVSQAQITGRPEWIWLALGTALMGLGTL...")
The embedding for that sequence is returned as a NumPy array. Currently there is no batching support, but this is planned if that is a desirable feature.
💭 Feedback
⚠️ Issue Tracker
Found a bug? Have an enhancement request? Head over to the GitHub issue tracker if you need to report or ask something. If you are filing in on a bug, please include as much information as you can about the issue, and try to recreate the same bug in a simple, easily reproducible situation.
🏗️ Contributing
Contributions are more than welcome! See
CONTRIBUTING.md
for more details.
📋 Changelog
This project adheres to Semantic Versioning and provides a changelog in the Keep a Changelog format.
⚖️ License
This library is provided under the GNU General Public License v3.0.
It includes some code adapted from the numpy-ml
which is also released under the GPL 3.0. The NEAR code and weights are
released under the BSD-3-Clause License
and are redistributed and adapted here under those terms.
This project is in no way not affiliated, sponsored, or otherwise endorsed
by the original NEAR authors.
It was developed by Martin Larralde during his
PhD project at the Leiden University Medical Center
in the Zeller team.
📚 References
- [1] Daniel Olson, Thomas Colligan, Daphne Demekas, Jack W Roddy, Ken Youens-Clark, Travis J Wheeler, NEAR: neural embeddings for amino acid relationships, Bioinformatics, Volume 41, Issue Supplement_1, July 2025, Pages i449–i457, doi:10.1093/bioinformatics/btaf198.
Project details
Release history Release notifications | RSS feed
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 mininear-0.1.0.tar.gz.
File metadata
- Download URL: mininear-0.1.0.tar.gz
- Upload date:
- Size: 27.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89d11e319dd469f4f685cfd39eff94f350f9959c179a0d7e7d6b3d358a8f01a7
|
|
| MD5 |
fa8ec75968a847b89bb5a0e3cb3c32c2
|
|
| BLAKE2b-256 |
e9a61e527d614d855245e1aa2492a03ec52c7ed7ed46d6bb4a9c77f5b7a045db
|
Provenance
The following attestation bundles were made for mininear-0.1.0.tar.gz:
Publisher:
test.yml on althonos/mininear
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mininear-0.1.0.tar.gz -
Subject digest:
89d11e319dd469f4f685cfd39eff94f350f9959c179a0d7e7d6b3d358a8f01a7 - Sigstore transparency entry: 439739051
- Sigstore integration time:
-
Permalink:
althonos/mininear@a47b617f0e0411fe89abbe9468766af5a93e66df -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/althonos
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
test.yml@a47b617f0e0411fe89abbe9468766af5a93e66df -
Trigger Event:
push
-
Statement type:
File details
Details for the file mininear-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mininear-0.1.0-py3-none-any.whl
- Upload date:
- Size: 27.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cacea90bc22ad50fae9dd67835d77e68a18625ea66259d1728cbf5a52cd72d53
|
|
| MD5 |
49b9a23a2b50939d71764106d32627ad
|
|
| BLAKE2b-256 |
903d3f1648629b9d8c6ba0c8043b7c835258884eef1e23d336f48428b7300ce2
|
Provenance
The following attestation bundles were made for mininear-0.1.0-py3-none-any.whl:
Publisher:
test.yml on althonos/mininear
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mininear-0.1.0-py3-none-any.whl -
Subject digest:
cacea90bc22ad50fae9dd67835d77e68a18625ea66259d1728cbf5a52cd72d53 - Sigstore transparency entry: 439739060
- Sigstore integration time:
-
Permalink:
althonos/mininear@a47b617f0e0411fe89abbe9468766af5a93e66df -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/althonos
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
test.yml@a47b617f0e0411fe89abbe9468766af5a93e66df -
Trigger Event:
push
-
Statement type: