Skip to main content

Python bindings for Oxagorn - fast tRNA/tmRNA gene finder (PyARAGORN compatible)

Project description

Oxagorn

A high-performance Rust reimplementation of ARAGORN for tRNA and tmRNA gene detection.

Why Oxagorn?

ARAGORN (Laslett & Canback, 2004) is a widely-used and well-established tool for detecting tRNA and tmRNA genes in nucleotide sequences. It has become an essential dependency for bacterial genome annotation pipelines such as Bakta, Prokka, and others.

However, ARAGORN was written in C over 20 years ago and has some limitations in modern computing environments:

  • Single-threaded only - Cannot utilize multiple CPU cores
  • No Python bindings - Requires subprocess calls or external wrappers
  • Legacy codebase - Difficult to maintain and extend

Oxagorn addresses these limitations:

  • Multi-core support - Parallel processing for 5-6x faster analysis
  • Native Python bindings - Drop-in replacement for PyARAGORN
  • Modern Rust implementation - Memory-safe, maintainable codebase
  • 100% compatible - Identical output to ARAGORN v1.2.41

Performance

Benchmarked on Arabidopsis thaliana genome (120 Mb):

Tool Time Speedup
ARAGORN v1.2.41 (C) 26.08s 1.0x
Oxagorn (single-threaded) 24.21s 1.08x
Oxagorn (6 threads) 4.58s 5.7x

Installation

Binary (Rust)

# From source
git clone https://github.com/necoli1822/oxagorn.git
cd oxagorn
cargo build --release

# The binary will be at target/release/oxagorn

Python Package

# From PyPI (coming soon)
pip install oxagorn

# From source
pip install -e .

Note: The Python package requires the oxagorn binary. Set OXAGORN_BIN environment variable or ensure it's in your PATH.

Usage

Command Line (ARAGORN compatible)

# Same options as ARAGORN
oxagorn -t -m -gc11 -w genome.fasta

# With parallel processing (new feature)
oxagorn -@4 genome.fasta  # Use 4 threads

Python (PyARAGORN compatible)

import oxagorn

# Create finder with bacterial genetic code
finder = oxagorn.RNAFinder(translation_table=11)

# Find RNA genes
genes = finder.find_rna(sequence)

for gene in genes:
    if gene.type == "tRNA":
        print(f"tRNA-{gene.amino_acid}({gene.anticodon}) at {gene.begin}-{gene.end}")
    elif gene.type == "tmRNA":
        print(f"tmRNA at {gene.begin}-{gene.end}, tag peptide: {gene.peptide()}")

Bakta Integration

Oxagorn can be used as a drop-in replacement for ARAGORN in Bakta:

# Option 1: Symlink
ln -sf /path/to/oxagorn ~/.local/bin/aragorn

# Option 2: PATH priority
export PATH="/path/to/oxagorn:$PATH"

API Reference

Python Classes

RNAFinder:

RNAFinder(
    translation_table: int = 1,  # NCBI genetic code (1-25)
    trna: bool = True,           # Search for tRNA genes
    tmrna: bool = True,          # Search for tmRNA genes
    linear: bool = False,        # Linear topology (default: circular)
)

TRNAGene: type, begin, end, strand, length, amino_acid, anticodon, sequence()

TMRNAGene: type, begin, end, strand, length, permuted, peptide(), sequence()

License

GPL-3.0 (same as ARAGORN)

Citation

If you use Oxagorn, please cite the original ARAGORN paper:

Laslett, D. and Canback, B. (2004) ARAGORN, a program for the detection of transfer RNA and transfer-messenger RNA genes in nucleotide sequences. Nucleic Acids Research, 32:11-16.

Authors

  • Dean Laslett - Original ARAGORN algorithm and implementation
  • Sunju Kim (@necoli1822) - Rust reimplementation

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

oxagorn-0.1.0.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

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

oxagorn-0.1.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file oxagorn-0.1.0.tar.gz.

File metadata

  • Download URL: oxagorn-0.1.0.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for oxagorn-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cf8b1ac43c5ba3668cdc9bd494f8eb52e433b25d615fce0f1c2e5f317e85f780
MD5 93a36edf0ab51597aba659ca721c2820
BLAKE2b-256 125ac1ad4a88cd13ab4ebddc373df2c86167f8e62dead97cde84a89b6f6bc8ed

See more details on using hashes here.

File details

Details for the file oxagorn-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: oxagorn-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for oxagorn-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4b9c531fcf9053dc91339bc3f5c0dc70915771e56a63902aeec4716768a351b7
MD5 2258460f17e3094506f5ad24718319fe
BLAKE2b-256 591d8835a3a6f82814948aada99a1127a3c4cc0c14eaf0bef7d674ffd21713bf

See more details on using hashes here.

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