pub struct QualityCount { /* private fields */ }Expand description
Per-position quality score accumulator.
Replicates the logic from Utilities/QualityCount.java.
Accumulates quality score counts for a single read position.
JAVA COMPAT: Uses a fixed 150-slot array indexed by ASCII value, matching
the Java long[] actualCounts = new long[150] exactly.
Implementations§
Source§impl QualityCount
impl QualityCount
pub fn new() -> Self
Sourcepub fn add_value(&mut self, quality_char: u8)
pub fn add_value(&mut self, quality_char: u8)
Record a quality character (raw ASCII value, not offset-adjusted).
Matches addValue(char c) which indexes by (int)c.
pub fn get_total_count(&self) -> u64
Sourcepub fn get_min_char(&self) -> Option<u8>
pub fn get_min_char(&self) -> Option<u8>
Lowest ASCII character with a non-zero count.
Sourcepub fn get_max_char(&self) -> Option<u8>
pub fn get_max_char(&self) -> Option<u8>
Highest ASCII character with a non-zero count.
Sourcepub fn get_mean(&self, offset: u8) -> f64
pub fn get_mean(&self, offset: u8) -> f64
Weighted mean quality score (offset-adjusted).
Matches getMean(int offset). Iterates from offset to 149,
accumulating count * (index - offset) and dividing by total count.
Returns NaN when count is 0 (Java’s 0.0/0 behaviour).
Sourcepub fn get_percentile(&self, offset: u8, percentile: u8) -> f64
pub fn get_percentile(&self, offset: u8, percentile: u8) -> f64
Percentile quality score (offset-adjusted).
Matches getPercentile(int offset, int percentile) exactly,
including the use of integer arithmetic for threshold calculation:
total = totalCounts * percentile / 100 (integer division)
This is critical for byte-exact output matching.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for QualityCount
impl RefUnwindSafe for QualityCount
impl Send for QualityCount
impl Sync for QualityCount
impl Unpin for QualityCount
impl UnsafeUnpin for QualityCount
impl UnwindSafe for QualityCount
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.