From 83ab90ff7d4f5523256e00fdeae6591f4c2e0f44 Mon Sep 17 00:00:00 2001 From: Bryce Lorenz Kille Date: Wed, 29 Nov 2023 19:44:15 -0600 Subject: [PATCH] Average kc over all segments in chain --- src/map/include/computeMap.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/map/include/computeMap.hpp b/src/map/include/computeMap.hpp index f9059d7..7c0faf9 100644 --- a/src/map/include/computeMap.hpp +++ b/src/map/include/computeMap.hpp @@ -1638,6 +1638,12 @@ namespace skch ) / it->n_merged; // this would scale directly by the number of mappings in the chain + //Mean kmer complexity of all mappings in the chain + it->kmerComplexity = ( std::accumulate( + it, it_end, 0.0, + [](double x, MappingResult &e){ return x + e.kmerComplexity; }) + ) / it->n_merged; // this would scale directly by the number of mappings in the chain + //Discard other mappings of this chain std::for_each( std::next(it), it_end, [&](MappingResult &e){ e.discard = 1; });