pub struct SamReader { /* private fields */ }Expand description
SAM file reader (streaming, memory-efficient)
Implementations§
Source§impl SamReader
impl SamReader
Sourcepub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self>
Open a SAM file from a path - handles .sam and .sam.gz automatically
Sourcepub fn new<R: BufRead + 'static>(reader: R) -> Self
pub fn new<R: BufRead + 'static>(reader: R) -> Self
Create a new SAM reader from any BufRead source
Sourcepub fn read_header(&mut self) -> Result<&SamHeader>
pub fn read_header(&mut self) -> Result<&SamHeader>
Read and parse the SAM header
This must be called before reading records. Header lines start with ‘@’, record lines don’t.
Sourcepub fn compute_stats(self, _config: Option<ParallelConfig>) -> Result<SamStats>
pub fn compute_stats(self, _config: Option<ParallelConfig>) -> Result<SamStats>
Compute statistics from this reader
Trait Implementations§
Source§impl GenomicReader for SamReader
impl GenomicReader for SamReader
Auto Trait Implementations§
impl Freeze for SamReader
impl !RefUnwindSafe for SamReader
impl !Send for SamReader
impl !Sync for SamReader
impl Unpin for SamReader
impl UnsafeUnpin for SamReader
impl !UnwindSafe for SamReader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filter<F>(self, filter: F) -> FilteredReader<Self::Record, Self, F>where
F: RecordFilter<Self::Record>,
fn filter<F>(self, filter: F) -> FilteredReader<Self::Record, Self, F>where
F: RecordFilter<Self::Record>,
Apply a filter to this reader Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more