Skip to content

Commit

Permalink
unbork the mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
ekg committed Oct 12, 2024
1 parent 60b1f03 commit 87e0bb1
Showing 1 changed file with 22 additions and 25 deletions.
47 changes: 22 additions & 25 deletions src/map/include/computeMap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -780,18 +780,33 @@ namespace skch
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}

//if (param.mergeMappings && param.split) {
// output->results = mergeMappingsInRange(output->results, param.chain_gap);
//}
// XXX we should fix this combined condition
auto& mappings = output->results;
if (param.mergeMappings && param.split) {
auto maximallyMergedMappings = mergeMappingsInRange(mappings, param.chain_gap);
filterMaximallyMerged(maximallyMergedMappings, param);
robin_hood::unordered_set<offset_t> kept_chains;
for (auto &mapping : maximallyMergedMappings) {
kept_chains.insert(mapping.splitMappingId);
}
mappings.erase(
std::remove_if(mappings.begin(), mappings.end(),
[&kept_chains](const MappingResult &mapping) {
return !kept_chains.count(mapping.splitMappingId);
}),
mappings.end());
} else {
filterNonMergedMappings(mappings, param);
}

mappingBoundarySanityCheck(input, output->results);
mappingBoundarySanityCheck(input, mappings);

if (param.filterLengthMismatches)
{
filterFalseHighIdentity(output->results);
filterFalseHighIdentity(mappings);
}

sparsifyMappings(output->results);
sparsifyMappings(mappings);

return output;
}
Expand All @@ -816,25 +831,7 @@ namespace skch
}

void processAggregatedMappings(const std::string& queryName, MappingResultsVector_t& mappings, std::ofstream& outstrm) {
if (param.mergeMappings && param.split) {
auto maximallyMergedMappings = mergeMappingsInRange(mappings, param.chain_gap);
filterMaximallyMerged(maximallyMergedMappings, param);
robin_hood::unordered_set<offset_t> kept_chains;
for (auto &mapping : maximallyMergedMappings) {
kept_chains.insert(mapping.splitMappingId);
}
mappings.erase(
std::remove_if(mappings.begin(), mappings.end(),
[&kept_chains](const MappingResult &mapping) {
return !kept_chains.count(mapping.splitMappingId);
}),
mappings.end());
//filterMaximallyMerged(mappings, param);
} else {
filterNonMergedMappings(mappings, param);
}

// Apply group filtering if necessary
// Apply group filtering aggregated across all targets
if (param.filterMode == filter::MAP || param.filterMode == filter::ONETOONE) {
MappingResultsVector_t filteredMappings;
filterByGroup(mappings, filteredMappings, param.numMappingsForSegment - 1, param.filterMode == filter::ONETOONE, *idManager);
Expand Down

0 comments on commit 87e0bb1

Please sign in to comment.