71 breaking releases

0.72.0 Feb 6, 2025
0.70.0 Jan 23, 2025
0.68.0 Dec 20, 2024
0.66.0 Nov 7, 2024
0.2.0 Jul 30, 2021

#1881 in Parser implementations

Download history 787/week @ 2024-10-29 791/week @ 2024-11-05 517/week @ 2024-11-12 571/week @ 2024-11-19 561/week @ 2024-11-26 661/week @ 2024-12-03 1191/week @ 2024-12-10 833/week @ 2024-12-17 235/week @ 2024-12-24 473/week @ 2024-12-31 829/week @ 2025-01-07 1000/week @ 2025-01-14 1125/week @ 2025-01-21 617/week @ 2025-01-28 1654/week @ 2025-02-04 708/week @ 2025-02-11

4,326 downloads per month
Used in 48 crates (8 directly)

MIT license

1MB
19K SLoC

noodles-sam handles the reading and writing of the SAM (Sequence Alignment/Map) format.

SAM is a format typically used to store biological sequences, either mapped to a reference sequence or unmapped. It has two sections: a header and a list of records.

The header mostly holds meta information about the data: a header describing the file format version, reference sequences reads map to, read groups reads belong to, programs that previously manipulated the data, and free-form comments. The header is optional and may be empty.

Each record represents a read, a linear alignment of a segment. Records have fields describing how a read was mapped (or not) to a reference sequence.

Examples

Read all records from a file

use noodles_sam as sam;

let mut reader = sam::io::reader::Builder::default().build_from_path("sample.sam")?;
let header = reader.read_header()?;

for result in reader.records() {
    let record = result?;
    // ...
}

Dependencies

~2.9–9.5MB
~80K SLoC