1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#![warn(missing_docs)]

//! **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,
//!
//! ```text
//!  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`.
//!
//! ```text
//! ACGT
//! NACT
//! GG
//! ```
//!
//! # Examples
//!
//! ## Read all records in a FASTA file
//!
//! ```no_run
//! # use std::{fs::File, io::{self, BufReader}};
//! 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?;
//!     // ...
//! }
//! # Ok::<(), io::Error>(())
//! ```

#[cfg(feature = "async")]
pub mod r#async;

pub mod fai;
pub mod io;
pub mod record;
pub mod repository;

#[deprecated(
    since = "0.39.0",
    note = "Use `noodles_fasta::io::indexed_reader` instead."
)]
pub use self::io::indexed_reader;

#[deprecated(since = "0.39.0", note = "Use `noodles_fasta::io::reader` instead.")]
pub use self::io::reader;

#[deprecated(since = "0.39.0", note = "Use `noodles_fasta::io::writer` instead.")]
pub use self::io::writer;

pub use self::{record::Record, repository::Repository};

#[deprecated(since = "0.39.0", note = "Use `noodles_fasta::io::index` instead.")]
pub use self::io::index;

#[deprecated(
    since = "0.39.0",
    note = "Use `noodles_fasta::io::IndexedReader` instead."
)]
pub use self::io::IndexedReader;

#[deprecated(since = "0.39.0", note = "Use `noodles_fasta::io::Reader` instead.")]
pub use self::io::Reader;

#[deprecated(since = "0.39.0", note = "Use `noodles_fasta::io::Writer` instead.")]
pub use self::io::Writer;

#[cfg(feature = "async")]
pub use self::r#async::io::Reader as AsyncReader;