#noodles #gtf #bam


Gene Transfer Format (GTF) reader and writer

20 breaking releases

new 0.21.0 Nov 14, 2023
0.19.0 Oct 26, 2023
0.14.0 Jul 6, 2023
0.8.0 Mar 3, 2023
0.1.0 Nov 11, 2021

#633 in Encoding

Download history 230/week @ 2023-07-25 228/week @ 2023-08-01 161/week @ 2023-08-08 147/week @ 2023-08-15 231/week @ 2023-08-22 166/week @ 2023-08-29 367/week @ 2023-09-05 527/week @ 2023-09-12 539/week @ 2023-09-19 484/week @ 2023-09-26 382/week @ 2023-10-03 591/week @ 2023-10-10 377/week @ 2023-10-17 649/week @ 2023-10-24 511/week @ 2023-10-31 471/week @ 2023-11-07

2,080 downloads per month
Used in 8 crates (via noodles)

MIT license

7.5K SLoC


crates.io Docs.rs CI status

noodles attempts to provide correct implementations of libraries for handling various bioinformatics file formats. It currently supports BAM 1.6, BCF 2.2, BED, BGZF, CRAM 3.0/3.1, CSI, FASTA, FASTQ, GFF3, GTF 2.2, htsget 1.3, refget 2.0, SAM 1.6, tabix, and VCF 4.3/4.4.


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.52.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, FASTA, FASTQ, SAM, tabix, and VCF)
  • libdeflate: Use libdeflate to encode and decode DEFLATE streams. (BGZF and CRAM)


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


noodles-gtf handles the reading and writing of the Gene Transfer Format (GTF).


~30K SLoC