Struct rust_htslib::bam::Reader
source · pub struct Reader { /* private fields */ }
Expand description
A BAM reader.
Implementations§
source§impl Reader
impl Reader
sourcepub fn from_stdin() -> Result<Self, BGZFError>
pub fn from_stdin() -> Result<Self, BGZFError>
Create a new Reader from STDIN.
sourcepub fn iter_chunk(
&mut self,
start: Option<i64>,
end: Option<i64>
) -> ChunkIterator<'_, Self> ⓘ
pub fn iter_chunk(
&mut self,
start: Option<i64>,
end: Option<i64>
) -> ChunkIterator<'_, Self> ⓘ
Iterator over the records between the (optional) virtual offsets start
and end
Arguments
-
start
- Optional starting virtual offset to seek to. Throws an error if it is not a valid virtual offset. -
end
- Read until the virtual offset is less thanend
Trait Implementations§
source§impl Read for Reader
impl Read for Reader
source§fn records(&mut self) -> Records<'_, Self> ⓘ
fn records(&mut self) -> Records<'_, Self> ⓘ
Iterator over the records of the fetched region.
Note that, while being convenient, this is less efficient than pre-allocating a
Record
and reading into it with the read
method, since every iteration involves
the allocation of a new Record
.
source§fn read(&mut self, record: &mut Record) -> Result<(), ReadError>
fn read(&mut self, record: &mut Record) -> Result<(), ReadError>
Read next BAM record into given record.
Use this method in combination with a single allocated record to avoid the reallocations
occurring with the iterator. Read more
source§fn header(&self) -> &HeaderView
fn header(&self) -> &HeaderView
Return the header.
source§fn seek(&mut self, offset: i64) -> Result<(), SeekError>
fn seek(&mut self, offset: i64) -> Result<(), SeekError>
Seek to the given virtual offset in the file
source§fn set_threads(&mut self, n_threads: usize) -> Result<(), ThreadingError>
fn set_threads(&mut self, n_threads: usize) -> Result<(), ThreadingError>
Activate multi-threaded BAM read support in htslib. This should permit faster
reading of large BAM files. Read more