Skip to content

Commit

Permalink
refactor: Apply subset-level filtering to reduce memory usage and imp…
Browse files Browse the repository at this point in the history
…rove mapping efficiency
  • Loading branch information
ekg committed Nov 21, 2024
1 parent f90892d commit 9ca2140
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/map/include/computeMap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -719,17 +719,24 @@ namespace skch
worker.join();
}

// Pre-filter mappings for this subset to reduce memory usage
aggregator.join();

// Filter mappings for this subset to reduce memory usage
for (auto& [querySeqId, mappings] : combinedMappings) {
if (param.filterMode == filter::MAP || param.filterMode == filter::ONETOONE) {
MappingResultsVector_t filteredMappings;
filterByGroup(mappings, filteredMappings, param.numMappingsForSegment - 1, false, *idManager, progress);
mappings = std::move(filteredMappings);

// Also apply length and identity filters
filterWeakMappings(mappings, std::floor(param.block_length / param.segLength));
if (param.filterLengthMismatches) {
filterFalseHighIdentity(mappings);
}
sparsifyMappings(mappings);
}
}

aggregator.join();

// Reset flags and clear aggregatedMappings for next iteration
reader_done.store(false);
workers_done.store(false);
Expand Down

0 comments on commit 9ca2140

Please sign in to comment.