70 breaking releases

new 0.71.0 Jan 24, 2025
0.69.0 Jan 19, 2025
0.68.0 Dec 20, 2024
0.66.0 Nov 7, 2024
0.2.0 Jul 30, 2021

#1872 in Parser implementations

Download history 1152/week @ 2024-10-06 1313/week @ 2024-10-13 602/week @ 2024-10-20 830/week @ 2024-10-27 712/week @ 2024-11-03 664/week @ 2024-11-10 523/week @ 2024-11-17 509/week @ 2024-11-24 710/week @ 2024-12-01 1081/week @ 2024-12-08 891/week @ 2024-12-15 416/week @ 2024-12-22 213/week @ 2024-12-29 931/week @ 2025-01-05 896/week @ 2025-01-12 1098/week @ 2025-01-19

3,163 downloads per month
Used in 49 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