From a11bcf94394f4dd81adcb7b640afad379d2e0229 Mon Sep 17 00:00:00 2001 From: "Erik Garrison (aider)" Date: Tue, 24 Sep 2024 16:36:44 -0500 Subject: [PATCH] fix: Resolve compilation errors in computeMap.hpp --- src/map/include/computeMap.hpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/map/include/computeMap.hpp b/src/map/include/computeMap.hpp index 0232c4c8..27ea0b3f 100644 --- a/src/map/include/computeMap.hpp +++ b/src/map/include/computeMap.hpp @@ -115,6 +115,15 @@ namespace skch //if refIdGroup[i] == refIdGroup[j], then sequence i and j have the same prefix; std::vector refIdGroup; + // Allowed set of queries + std::unordered_set allowed_query_names; + + // Vector to store all read mappings + MappingResultsVector_t allReadMappings; + + // Mutex for allReadMappings + std::mutex allReadMappings_mutex; + public: /** @@ -273,10 +282,6 @@ namespace skch MappingResultsVector_t allReadMappings; // Aggregate mapping results for the complete run // Allowed set of queries - std::unordered_set allowed_query_names; - - // Mutex for allReadMappings - std::mutex allReadMappings_mutex; if (!param.query_list.empty()) { std::ifstream filter_list(param.query_list); std::string name; @@ -475,8 +480,8 @@ namespace skch if (param.filterMode == filter::ONETOONE) { // Save for another filtering round - std::lock_guard guard(allReadMappings_mutex); - allReadMappings.insert(allReadMappings.end(), output->readMappings.begin(), output->readMappings.end()); + std::lock_guard guard(this->allReadMappings_mutex); + this->allReadMappings.insert(this->allReadMappings.end(), output->readMappings.begin(), output->readMappings.end()); } else { // Report mapping reportReadMappings(output->readMappings, output->qseqName, outstrm); @@ -497,12 +502,12 @@ namespace skch int n_mappings = param.numMappingsForSegment - 1; // Group sequences by query prefix, then pass to ref filter - auto subrange_begin = allReadMappings.begin(); - auto subrange_end = allReadMappings.begin(); + auto subrange_begin = this->allReadMappings.begin(); + auto subrange_end = this->allReadMappings.begin(); MappingResultsVector_t tmpMappings; MappingResultsVector_t filteredMappings; - while (subrange_end != allReadMappings.end()) { + while (subrange_end != this->allReadMappings.end()) { if (param.skip_prefix) { int currGroup = this->getRefGroup(qmetadata[subrange_begin->querySeqId].name); subrange_end = std::find_if_not(subrange_begin, allReadMappings.end(), [this, currGroup](const auto& allReadMappings_candidate) {