pub struct MeanReadLengths {
pub on_target: isize,
pub off_target: isize,
pub total: isize,
/* private fields */
}
Expand description
Represents the mean read lengths for on-target, off-target, and total reads.
Fields§
§on_target: isize
The mean read length of on-target reads.
off_target: isize
The mean read length of off-target reads.
total: isize
The mean read length of all reads (on-target + off-target).
Implementations§
Source§impl MeanReadLengths
impl MeanReadLengths
Sourcepub fn update_lengths(&mut self, paf: &PafRecord, on_target: bool)
pub fn update_lengths(&mut self, paf: &PafRecord, on_target: bool)
Updates the mean read lengths for on-target, off-target, and total reads based on the provided PAF record and whether the read is on-target or off-target.
§Arguments
paf
- A reference to thePafRecord
representing the alignment record for a read.on_target
- A boolean indicating whether the read is on-target (true) or off-target (false).
§Example
use readfish_tools::{MeanReadLengths, paf::PafRecord};
let mut mean_lengths = MeanReadLengths::new();
let paf_record = PafRecord::new("read123 200 0 200 + contig123 300 0 300 200 200 50 ch=1".split(" ").collect()).unwrap();
mean_lengths.update_lengths(&paf_record, true);
Trait Implementations§
Source§impl Debug for MeanReadLengths
impl Debug for MeanReadLengths
Auto Trait Implementations§
impl Freeze for MeanReadLengths
impl RefUnwindSafe for MeanReadLengths
impl Send for MeanReadLengths
impl Sync for MeanReadLengths
impl Unpin for MeanReadLengths
impl UnwindSafe for MeanReadLengths
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> 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