Skip to content

Commit

Permalink
Merge pull request #214 from bkille/fix-kmer-complexity
Browse files Browse the repository at this point in the history
Average kmer complexities over chain in mergeMappingsInRange
  • Loading branch information
AndreaGuarracino committed Nov 29, 2023
2 parents f116569 + 7e762a1 commit 637f8ce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/map/include/computeMap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1655,6 +1655,11 @@ namespace skch
[](double x, MappingResult &e){ return x + e.nucIdentity; })
) / it->n_merged; // this would scale directly by the number of mappings in the chain

//Mean identity of all kmer complexities 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; });
Expand Down

0 comments on commit 637f8ce

Please sign in to comment.