pub struct BAMFile { /* private fields */ }Expand description
BAM/SAM file reader that supports both BAM and SAM input formats.
Mirrors Sequence.BAMFile in Java. Uses a look-ahead design
where read_next() is called at construction time and after each next() call.
Implementations§
Source§impl BAMFile
impl BAMFile
Sourcepub fn open(path: &Path, is_bam: bool, only_mapped: bool) -> Result<Self>
pub fn open(path: &Path, is_bam: bool, only_mapped: bool) -> Result<Self>
Open a BAM or SAM file for reading.
If is_bam is true, the file is read as BAM format; otherwise as SAM.
If only_mapped is true, unmapped reads are skipped.
The Java constructor opens the file, creates a SamReader with SILENT validation stringency, gets an iterator, and calls readNext() to prime the look-ahead buffer.
Trait Implementations§
Source§impl SequenceFile for BAMFile
impl SequenceFile for BAMFile
Source§fn is_colorspace(&self) -> bool
fn is_colorspace(&self) -> bool
BAM/SAM files are never colorspace.
Java’s BAMFile.isColorspace() always returns false.
Source§fn percent_complete(&self) -> f64
fn percent_complete(&self) -> f64
Java tracks progress using the raw FileInputStream position divided by file size. For BAM files, this gives a rough estimate since the underlying file is BGZF compressed. We estimate using the record size heuristic from Java when precise position tracking is not available.
Auto Trait Implementations§
impl Freeze for BAMFile
impl RefUnwindSafe for BAMFile
impl Send for BAMFile
impl Sync for BAMFile
impl Unpin for BAMFile
impl UnsafeUnpin for BAMFile
impl UnwindSafe for BAMFile
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
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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.