Filters out low-frequency mismatches and merges them into the match count m.
(&mut self, threshold: f64)
| 216 | impl 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)] |
no outgoing calls