MCPcopy Create free account
hub / github.com/alignoth/alignoth / filter_mismatches

Method filter_mismatches

src/plot.rs:218–232  ·  view source on GitHub ↗

Filters out low-frequency mismatches and merges them into the match count m.

(&mut self, threshold: f64)

Source from the content-addressed store, hash-verified

216impl BaseCoverage {
217 /// Filters out low-frequency mismatches and merges them into the match count m.
218 pub fn filter_mismatches(&mut self, threshold: f64) {
219 let total = self.a + self.t + self.g + self.c + self.m;
220 if total == 0 {
221 return;
222 }
223
224 let mut removed = 0;
225 for b in [&mut self.a, &mut self.t, &mut self.g, &mut self.c] {
226 if (*b as f64 / total as f64 * 100.0) < threshold {
227 removed += *b;
228 *b = 0;
229 }
230 }
231 self.m += removed;
232 }
233}
234
235#[derive(Serialize, Debug, Eq, PartialEq, Default, Clone)]

Callers 2

from_readsMethod · 0.80
test_filter_mismatchesFunction · 0.80

Calls

no outgoing calls

Tested by 1

test_filter_mismatchesFunction · 0.64