Skip to main content

PyOrthoANI Stars

A Python implementation of the OrthoANI algorithm for nucleotide identity measurement.

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

🗺️ Overview

OrthoANI is a metric proposed by Lee et al.[1] in 2016 to improve computation of Average Nucleotide Identity. It uses BLASTn to find orthologous blocks in a pair of sequences, and then computes the average identity only considering alignments of reciprocal orthologs.

Algorithm

PyOrthoANI is a reimplementation of the closed-source Java implementation provided by the authors on ezbiocloud.net. It relies on Biopython to handle the I/O, and calls the BLAST+ binaries using the subprocess module of the Python standard library.

🔧 Installing

Installing with pip is the easiest:

$ pip install pyorthoani

PyOrthoANI also requires the BLAST+ binaries to be installed on your machine and available somewhere in your $PATH.

💡 Example

Use Biopython to load two FASTA files, and then orthoani.orthoani to compute the OrthoANI metric between them:

import pyorthoani
from Bio.SeqIO import read

genome_1 = read("sequence1.fa", "fasta")
genome_2 = read("sequence2.fa", "fasta")

ani = pyorthoani.orthoani(genome_1, genome_2)

pyorthoani can also be used from the CLI using a very simple command-line interface mimicking the original Java tool:

$ pyorthoani -q sequence1.fa -r sequence2.fa
57.25

🐏 Memory

orthoani uses the machine temporary folder to handle BLAST+ input and output files, which is configurable through tempfile.tempdir. On some systems (like ArchLinux), this filesystem can reside in memory, which means that your computer could have trouble processing very large files. If this happens, try changing the value of the tempfile.tempdir to a directory that is actually located on physical storage.

📏 Precision

Values computed by this package and the original Java implementation may differ slightly because in Java the authors perform rounding of floating-point values at the sub-percent level, while this library uses the full values.

🔖 Citation

PyOrthoANI is scientific software; it is submitted for publication and is currently available as a pre-print on bioRxiv. Please cite both PyOrthoANI and OrthoANI if you are using it in an academic work, for instance as:

PyOrthoANI (Larralde et al., 2024), a Python implementation of OrthoANI (Lee et al., 2016).

📜 About

This library is provided under the open-source MIT license.

This project is in no way not affiliated, sponsored, or otherwise endorsed by the original OrthoANI authors. It was developed by Martin Larralde during his PhD project at the European Molecular Biology Laboratory in the Zeller team.

📚 References

  • [1] Imchang Lee, Yeong Ouk Kim, Sang-Cheol Park and Jongsik Chun. OrthoANI: An improved algorithm and software for calculating average nucleotide identity (2016). International Journal of Systematic and Evolutionary Microbiology. doi:10.1099/ijsem.0.000760. PMID:26585518.

Release files for pyorthoani 0.7.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 pyorthoani 0.7.0
File Size Uploaded
pyorthoani-0.7.0.tar.gz 14.7 kB Details

Built distribution (wheel)

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

Total release size: 26.7 kB

Release files / pyorthoani-0.7.0.tar.gz

Download URL pyorthoani-0.7.0.tar.gz
Size 14.7 kB
Tags Source
SHA-256 checksum
How to use checksums
37a5a22dc54c45740f56bb94e0fefaf9d4adae3a71bda74d2a5deae4775ee908
BLAKE2b-256 checksum
How to use checksums
947324eb53cc1e24ae2e9e2235ecaa5d42c80ae93f20b8c4c098199761506014
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 Feb 21, 2025.

Transparency log

Release files / pyorthoani-0.7.0-py3-none-any.whl

Download URL pyorthoani-0.7.0-py3-none-any.whl
Size 12.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e6bead9606e140b0f23874163ffdcc12ffb40260ed20fa002b23acd7ec1b6799
BLAKE2b-256 checksum
How to use checksums
13229a6f4202d71311a73502a85f491e07591c269457f87eced642c9734f8a60
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 Feb 21, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

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