Skip to main content

🔭 mininear Stars

A NumPy port of the NEAR code for embedding protein sequences.

Actions Coverage License PyPI Bioconda Wheel Python Versions Python Implementations Source Mirror GitHub issues Docs Changelog Downloads

🗺️ 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.

Metadata

Release files for mininear 0.1.0

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

Source distribution (sdist)

Source distribution for mininear 0.1.0
File Size Uploaded
mininear-0.1.0.tar.gz 27.0 MB Details

Built distribution (wheel)

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

Total release size: 54.1 MB

Release files / mininear-0.1.0.tar.gz

Download URL mininear-0.1.0.tar.gz
Size 27.0 MB
Tags Source
SHA-256 checksum
How to use checksums
89d11e319dd469f4f685cfd39eff94f350f9959c179a0d7e7d6b3d358a8f01a7
BLAKE2b-256 checksum
How to use checksums
e9a61e527d614d855245e1aa2492a03ec52c7ed7ed46d6bb4a9c77f5b7a045db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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 27, 2025.

Transparency log

Release files / mininear-0.1.0-py3-none-any.whl

Download URL mininear-0.1.0-py3-none-any.whl
Size 27.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
cacea90bc22ad50fae9dd67835d77e68a18625ea66259d1728cbf5a52cd72d53
BLAKE2b-256 checksum
How to use checksums
903d3f1648629b9d8c6ba0c8043b7c835258884eef1e23d336f48428b7300ce2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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 27, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

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