INNER CODE UNIT · Rust
get_bin
google/best · src/stats.rs:131
pub fn get_bin(&self, a: &AlnStats) -> String {
match self {
Self::QLen(step) => format!("{}", a.q_len / step * step),
Self::SubreadPasses(step) => format!(
"{}",
a.subread_passes.expect("Subread passes not found!") / step * step
),
Self::MapQ(step) => format!("{}", a.mapq / step * step),
Self::MeanQual(step) => format!("{}", a.mean_qual / step * step),
Self::GcContent(step) => format!("{:.6}", (a.gc_content / step).floor() * step),
Self::ConcordanceQv(step) => format!("{:.2}", (a.concordance_qv / step).floor() * step),
}
}
}
impl fmt::Display for BinType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {