From 972222d8b265c959fcb5074f93ce6fb178b08714 Mon Sep 17 00:00:00 2001 From: Erik Garrison Date: Sun, 15 Sep 2024 15:52:31 -0500 Subject: [PATCH] simplify maximally merged filter --- src/map/include/computeMap.hpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/map/include/computeMap.hpp b/src/map/include/computeMap.hpp index 669422f2..9ec402b7 100644 --- a/src/map/include/computeMap.hpp +++ b/src/map/include/computeMap.hpp @@ -696,7 +696,7 @@ namespace skch if (param.mergeMappings) { mergeMappingsInRange(unfilteredMappings, param.chain_gap); - unfilteredMappings = filterMaximallyMerged(unfilteredMappings, param); + filterMaximallyMerged(unfilteredMappings, param); } else { @@ -1569,21 +1569,18 @@ namespace skch * @param[in] param Algorithm parameters * @return Filtered mappings */ - MappingResultsVector_t filterMaximallyMerged(const MappingResultsVector_t& readMappings, const Parameters& param) + void filterMaximallyMerged(MappingResultsVector_t& readMappings, const Parameters& param) { - MappingResultsVector_t filteredMappings = readMappings; - // Filter weak mappings - filterWeakMappings(filteredMappings, std::floor(param.block_length / param.segLength)); + filterWeakMappings(readMappings, std::floor(param.block_length / param.segLength)); // Apply group filtering if necessary if (param.filterMode == filter::MAP || param.filterMode == filter::ONETOONE) { MappingResultsVector_t groupFilteredMappings; - filterByGroup(filteredMappings, groupFilteredMappings, param.numMappingsForSegment - 1, false); - filteredMappings = std::move(groupFilteredMappings); + filterByGroup(readMappings, groupFilteredMappings, param.numMappingsForSegment - 1, false); + readMappings = std::move(groupFilteredMappings); } - return filteredMappings; } /**