Skip to content

Commit e8247eb

Browse files
committed
Update FeatureGroupingAlgorithmQT.cpp
1 parent 6a5e1b5 commit e8247eb

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/openms/source/ANALYSIS/MAPMATCHING/FeatureGroupingAlgorithmQT.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include <OpenMS/ANALYSIS/ID/IonIdentityMolecularNetworking.h>
1212
#include <OpenMS/METADATA/ProteinIdentification.h>
1313
#include <OpenMS/METADATA/PeptideIdentification.h>
14-
1514
#include <OpenMS/ANALYSIS/MAPMATCHING/FeatureGroupingAlgorithm.h>
1615
#include <OpenMS/CONCEPT/LogStream.h>
1716

@@ -61,9 +60,10 @@ namespace OpenMS
6160
bool mz_ppm = param_.getValue("distance_MZ:unit").toString() == "ppm";
6261
double rt_tol = param_.getValue("distance_RT:max_difference");
6362

63+
// Greedy pass to merge unlinked features (singletons)
6464
for (auto it1 = out.begin(); it1 != out.end(); ++it1)
6565
{
66-
66+
// Only look at features that failed to link in Pass 1
6767
if (it1->getFeatures().size() != 1) continue;
6868

6969
for (auto it2 = it1 + 1; it2 != out.end(); ++it2)
@@ -121,11 +121,17 @@ namespace OpenMS
121121

122122
if (match_found)
123123
{
124-
124+
// 1. Merge the feature from it2 into it1
125125
it1->insert(*it2->getFeatures().begin());
126+
127+
// 2. Annotate the rescue for downstream data integrity
126128
it1->setMetaValue("isotope_shift_rescued", "true");
129+
130+
// 3. Log the successful rescue event
127131
OPENMS_LOG_DEBUG << "FeatureGroupingAlgorithmQT: Isotope-shift rescue applied. Merged map "
128132
<< candidate_map_index << " into consensus feature." << std::endl;
133+
134+
// 4. Remove it2 from the map so it isn't processed again
129135
it2 = out.erase(it2);
130136
--it2;
131137
}

0 commit comments

Comments
 (0)