Skip to content

Latest commit

 

History

History
124 lines (92 loc) · 4.95 KB

File metadata and controls

124 lines (92 loc) · 4.95 KB

Language Code Style Type Checked PEP8 Code Coverage License


Python package PyPI version PyPI download total Bioconda DOI


pybwa

Python bindings for bwa, the Burrows-Wheeler Aligner. Pybwa provides native Python access to bwa's indexing and alignment algorithms, returning pysam AlignedSegment objects for downstream analysis.

Fulcrum Genomics

Visit us at Fulcrum Genomics to learn more about how we can power your Bioinformatics with pybwa and beyond.

Quick Start

Align reads with bwa mem

bwa mem is the recommended algorithm for reads longer than ~70bp (Illumina, etc.).

from pybwa import BwaMem

mem = BwaMem(prefix="/path/to/genome.fasta")
for recs in mem.align(queries=["CTCAAGGTTGTTGCAAGGGGGTCTATGTGAACAAA"]):
    for rec in recs:
        print(rec)

Align short reads with bwa aln

bwa aln is designed for short reads (<100bp, e.g. Illumina).

from pybwa import BwaAln

aln = BwaAln(prefix="/path/to/genome.fasta")
for rec in aln.align(queries=["GATTACA"]):
    print(rec)

Reuse an index across aligners

Load a BwaIndex once and pass it to multiple aligners to avoid reloading:

from pybwa import BwaIndex, BwaAln, BwaMem

index = BwaIndex(prefix="/path/to/genome.fasta")
aln = BwaAln(index=index)
mem = BwaMem(index=index)

Installation

Install with pip install pybwa or conda install -c bioconda pybwa.

Requires Python 3.10+

Documentation

See the full documentation on pybwa.readthedocs.org.


Fulcrum Genomics

Visit us at Fulcrum Genomics to learn more about how we can power your Bioinformatics with pybwa and beyond.