56 breaking releases

new 0.57.0 Apr 22, 2024
0.55.0 Mar 28, 2024
0.49.0 Dec 14, 2023
0.48.0 Nov 14, 2023
0.2.0 Jul 30, 2021

#1278 in Parser implementations

Download history 294/week @ 2024-01-01 364/week @ 2024-01-08 135/week @ 2024-01-15 535/week @ 2024-01-22 423/week @ 2024-01-29 618/week @ 2024-02-05 864/week @ 2024-02-12 288/week @ 2024-02-19 838/week @ 2024-02-26 746/week @ 2024-03-04 820/week @ 2024-03-11 366/week @ 2024-03-18 450/week @ 2024-03-25 694/week @ 2024-04-01 351/week @ 2024-04-08 548/week @ 2024-04-15

2,075 downloads per month
Used in 34 crates (9 directly)

MIT license

760KB
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
~81K SLoC