Struct bio::io::fasta::IndexedReader
source · Expand description
A FASTA reader with an index as created by SAMtools (.fai).
Fields
index: Index
Implementations
sourceimpl IndexedReader<File>
impl IndexedReader<File>
sourceimpl<R: Read + Seek> IndexedReader<R>
impl<R: Read + Seek> IndexedReader<R>
sourcepub fn new<I: Read>(fasta: R, fai: I) -> Result<Self>
pub fn new<I: Read>(fasta: R, fai: I) -> Result<Self>
Read from a FASTA and its index, both given as io::Read
. FASTA has to
be io::Seek
in addition.
sourcepub fn with_index(fasta: R, index: Index) -> Self
pub fn with_index(fasta: R, index: Index) -> Self
Read from a FASTA and its index, the first given as io::Read
, the
second given as index object.
sourcepub fn fetch(&mut self, seq_name: &str, start: u64, stop: u64) -> Result<()>
pub fn fetch(&mut self, seq_name: &str, start: u64, stop: u64) -> Result<()>
Fetch an interval from the sequence with the given name for reading. (stop position is exclusive).
sourcepub fn fetch_by_rid(&mut self, rid: usize, start: u64, stop: u64) -> Result<()>
pub fn fetch_by_rid(&mut self, rid: usize, start: u64, stop: u64) -> Result<()>
Fetch an interval from the sequence with the given record index for reading. (stop position is exclusive).
sourcepub fn fetch_all(&mut self, seq_name: &str) -> Result<()>
pub fn fetch_all(&mut self, seq_name: &str) -> Result<()>
Fetch the whole sequence with the given name for reading.
sourcepub fn fetch_all_by_rid(&mut self, rid: usize) -> Result<()>
pub fn fetch_all_by_rid(&mut self, rid: usize) -> Result<()>
Fetch the whole sequence with the given record index for reading.
sourcepub fn read(&mut self, seq: &mut Text) -> Result<()>
pub fn read(&mut self, seq: &mut Text) -> Result<()>
Read the fetched sequence into the given vector.
sourcepub fn read_iter(&mut self) -> Result<IndexedReaderIterator<'_, R>>
pub fn read_iter(&mut self) -> Result<IndexedReaderIterator<'_, R>>
Return an iterator yielding the fetched sequence.
Trait Implementations
Auto Trait Implementations
impl<R> RefUnwindSafe for IndexedReader<R>where
R: RefUnwindSafe,
impl<R> Send for IndexedReader<R>where
R: Send,
impl<R> Sync for IndexedReader<R>where
R: Sync,
impl<R> Unpin for IndexedReader<R>where
R: Unpin,
impl<R> UnwindSafe for IndexedReader<R>where
R: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more