#bam #bioinformatics #reader #writer #binary

noodles-bam

Binary Alignment/Map (BAM) format reader and writer

17 breaking releases

Uses new Rust 2021

0.18.0 Apr 14, 2022
0.17.0 Mar 29, 2022
0.16.0 Mar 2, 2022
0.12.0 Dec 16, 2021
0.2.1 Jul 30, 2021
Download history 55/week @ 2022-01-29 38/week @ 2022-02-05 142/week @ 2022-02-12 97/week @ 2022-02-19 122/week @ 2022-02-26 79/week @ 2022-03-05 78/week @ 2022-03-12 98/week @ 2022-03-19 92/week @ 2022-03-26 63/week @ 2022-04-02 140/week @ 2022-04-09 82/week @ 2022-04-16 89/week @ 2022-04-23 157/week @ 2022-04-30 508/week @ 2022-05-07 681/week @ 2022-05-14

1,467 downloads per month
Used in 3 crates

MIT license

1MB
18K SLoC

noodles

crates.io Docs.rs CI status

noodles is a library for handling various bioinformatics file formats. It currently includes readers and writers for BAM 1.6, BCF 2.2, BGZF, CRAM 3.0, CSI, FASTA, FASTQ, GFF3, GTF 2.2, SAM 1.6, tabix, and VCF 4.3.

Usage

noodles is published on crates.io. Early versions can be used in projects, but keep in mind that the API is still considered experimental.

noodles is split into multiple crates by file format. For convenience, a top-level meta crate named noodles can be added to your project's dependency list; and formats, listed as features. For example, to work with the BAM format, enable the bam feature.

noodles = { version = "0.13.0", features = ["bam"] }

Each enabled feature can then be imported by its re-exported name, e.g.,

use noodles::bam;

Feature flags

Individual crates may have optional features that can be enabled using feature flags.

  • async: Enables asynchronous I/O with Tokio. (BAM, BCF, BGZF, CRAM, CSI, FASTQ, SAM, tabix, and VCF)
  • libdeflate: Use libdeflate to encode and decode DEFLATE streams. (BGZF)

Examples

Each crate may have its own examples directory, and all examples are runnable as an application. After cloning the repository, run cargo run --release --example for a list of available examples. Use the example name as the option argument and append program arguments to the command, e.g.,

cargo run --release --example bam_write > sample.bam
cargo run --release --example bam_read_header sample.bam

Dependencies

~1.1–2.2MB
~38K SLoC