Skip to main content

A Rust-based BAM depth calculator for Python.

Project description

🦀 rustbam - Fast BAM Depth Calculator in Rust & Python

🚀 rustbam is a high-performance BAM depth calculator written in Rust, with Python bindings for fast and efficient genomic data analysis. It offers a pysam-like API but is significantly faster due to Rust’s performance advantages.

📦 Installation

Install from PyPI (No Conda Required)

You can install rustbam directly with pip:

pip install rustbam

🛠️ Usage

Python API

After installation, you can use rustbam in Python:

python

CopyEdit

import rustbam
depths = rustbam.get_depth("example.bam", "chr1", 1000000, 1000100, 
    step=10,     # As in range(start, end, step)
    min_mapq=0,  # Minimum mapping quality (samtools -q)
    min_bq=13,   # Minimum base quality (samtools -Q)
    max_depth=8000  # Max per-file depth (samtools -d)
)
print(depths)

CLI (Command Line Interface)

Coming soon! 🚀


🔥 Features

Fast: Uses Rust’s efficient rust-htslib for BAM processing.
Python bindings: Seamless integration with Python via pyo3.
Custom filtering: Supports read quality (-q), base quality (-Q), and max depth (-d).
Supports large BAM files: Uses IndexedReader for efficient region querying.


📜 License

rustbam is released under the MIT License. See LICENSE for details.


🤝 Contributing

  1. Fork the repo on GitHub.
  2. Create a new branch: git checkout -b feature-new
  3. Commit your changes: git commit -m "Add new feature"
  4. Push to your branch: git push origin feature-new
  5. Open a Pull Request 🎉

🌍 Acknowledgments

Built using rust-htslib and pyo3.

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

rustbam-0.1.0.tar.gz (18.0 kB view details)

Uploaded Source

Built Distribution

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

rustbam-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

File details

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

File metadata

  • Download URL: rustbam-0.1.0.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.8.1

File hashes

Hashes for rustbam-0.1.0.tar.gz
Algorithm Hash digest
SHA256 52fc110932534fb6691551a33ab12e9fe5a6c0e070176632fd1c469d52858e05
MD5 8c832bf476803d02c601a9a4811e9d30
BLAKE2b-256 a792df464c3c94e4f71c85925d9ac808a3a8ab0f01f52e364677e3cd139fd1f7

See more details on using hashes here.

File details

Details for the file rustbam-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rustbam-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a322c0d112a08065b89495ce328875a418492bd8763e8d627216fa545c14700c
MD5 e405100be7b483882432b4d85c3c3677
BLAKE2b-256 646686c586794ffd3f06ffa0ac8fa602c16dbeec6b29fa48e33573b6cfde91db

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