File tree Expand file tree Collapse file tree
src/openms/source/ANALYSIS/MAPMATCHING Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 }
You can’t perform that action at this time.
0 commit comments