45 breaking releases

new 0.46.0 Dec 12, 2024
0.45.0 Oct 22, 2024
0.44.0 Sep 26, 2024
0.41.0 Jul 14, 2024
0.2.0 Jul 30, 2021

#1277 in Parser implementations

Download history 589/week @ 2024-08-23 1246/week @ 2024-08-30 510/week @ 2024-09-06 580/week @ 2024-09-13 637/week @ 2024-09-20 641/week @ 2024-09-27 818/week @ 2024-10-04 1733/week @ 2024-10-11 907/week @ 2024-10-18 933/week @ 2024-10-25 785/week @ 2024-11-01 702/week @ 2024-11-08 577/week @ 2024-11-15 887/week @ 2024-11-22 803/week @ 2024-11-29 917/week @ 2024-12-06

3,231 downloads per month
Used in 57 crates (6 directly)

MIT license

250KB
5.5K SLoC

noodles-fasta handles and reading and writing of the FASTA format.

FASTA is a text format with no formal specification and only has de facto rules. It typically consists of a list of records, each with a definition on the first line and a sequence in the following lines.

The definition starts with a > (greater than) character, and directly after it is the reference sequence name. Optionally, whitespace may be used a delimiter for an extra description or metadata of the sequence. For example,

 reference sequence name
 | |
>sq0 LN:13
     |   |
     description

The sequence is effectively a byte array of characters representing a base. It is typically hard wrapped at an arbitrary width. For example, the following makes up the sequence ACGTNACTGG.

ACGT
NACT
GG

Examples

Read all records in a FASTA file

use noodles_fasta as fasta;

let mut reader = File::open("reference.fa")
    .map(BufReader::new)
    .map(fasta::io::Reader::new)?;

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

Dependencies

~1.4–7.5MB
~50K SLoC