Struct noodles_fasta::fai::Reader [−][src]
pub struct Reader<R> { /* fields omitted */ }
Expand description
A FASTA index reader.
Implementations
Creates a FASTA index reader.
Examples
use noodles_fasta::fai;
let data = b"sq0\t13\t5\t80\t81\nsq1\t21\t19\t80\t81\n";
let mut reader = fai::Reader::new(&data[..]);
Reads a FASTA index.
The position of the stream is expected to be at the start or at the start of a record.
Examples
use noodles_fasta::fai;
let data = b"sq0\t13\t5\t80\t81\nsq1\t21\t19\t80\t81\n";
let mut reader = fai::Reader::new(&data[..]);
let index = reader.read_index()?;
assert_eq!(index, vec![
fai::Record::new(String::from("sq0"), 13, 5, 80, 81),
fai::Record::new(String::from("sq1"), 21, 19, 80, 81),
]);