Skip to main content

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

Project description

🔭 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.

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

mininear-0.1.0.tar.gz (27.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mininear-0.1.0-py3-none-any.whl (27.0 MB view details)

Uploaded Python 3

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

Hashes for mininear-0.1.0.tar.gz
Algorithm Hash digest
SHA256 89d11e319dd469f4f685cfd39eff94f350f9959c179a0d7e7d6b3d358a8f01a7
MD5 fa8ec75968a847b89bb5a0e3cb3c32c2
BLAKE2b-256 e9a61e527d614d855245e1aa2492a03ec52c7ed7ed46d6bb4a9c77f5b7a045db

See more details on using hashes here.

Provenance

The following attestation bundles were made for mininear-0.1.0.tar.gz:

Publisher: test.yml on althonos/mininear

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for mininear-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cacea90bc22ad50fae9dd67835d77e68a18625ea66259d1728cbf5a52cd72d53
MD5 49b9a23a2b50939d71764106d32627ad
BLAKE2b-256 903d3f1648629b9d8c6ba0c8043b7c835258884eef1e23d336f48428b7300ce2

See more details on using hashes here.

Provenance

The following attestation bundles were made for mininear-0.1.0-py3-none-any.whl:

Publisher: test.yml on althonos/mininear

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page