Encode the match coverage as differences (Δ to previous position)
(&self)
| 238 | impl EncodedBaseCoverage { |
| 239 | /// Encode the match coverage as differences (Δ to previous position) |
| 240 | pub fn matches(&self) -> String { |
| 241 | let mut last = 0; |
| 242 | self.0 |
| 243 | .iter() |
| 244 | .map(|bc| { |
| 245 | let diff = bc.m as isize - last; |
| 246 | last = bc.m as isize; |
| 247 | diff.to_string() |
| 248 | }) |
| 249 | .collect::<Vec<_>>() |
| 250 | .join("|") |
| 251 | } |
| 252 | |
| 253 | /// Helper for sparse encoding of a base track (A, T, G, C) |
| 254 | fn encode_sparse<F>(&self, f: F) -> String |