61 breaking releases

0.62.0 Jul 14, 2024
0.60.0 May 16, 2024
0.55.0 Mar 28, 2024
0.49.0 Dec 14, 2023
0.2.0 Jul 30, 2021

#1425 in Parser implementations

Download history 493/week @ 2024-04-04 583/week @ 2024-04-11 717/week @ 2024-04-18 331/week @ 2024-04-25 616/week @ 2024-05-02 225/week @ 2024-05-09 665/week @ 2024-05-16 707/week @ 2024-05-23 381/week @ 2024-05-30 349/week @ 2024-06-06 716/week @ 2024-06-13 446/week @ 2024-06-20 195/week @ 2024-06-27 231/week @ 2024-07-04 805/week @ 2024-07-11 322/week @ 2024-07-18

1,603 downloads per month
Used in 36 crates (9 directly)

MIT license

775KB
18K 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.8–5MB
~80K SLoC