Skip to content

Commit

Permalink
Issue 707: Replace old isotopic extraction code with new isotopic ext…
Browse files Browse the repository at this point in the history
…raction code.
  • Loading branch information
PMSeitzer committed Apr 24, 2024
1 parent cc3aee7 commit 0c186d2
Showing 1 changed file with 9 additions and 19 deletions.
28 changes: 9 additions & 19 deletions src/maven/background_peaks_update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,22 +535,6 @@ void BackgroundPeakUpdate::processSlices(vector<mzSlice*>&slices, string setName

if (group.blankMax*minSignalBlankRatio > group.maxIntensity) continue;

group.chargeState = group.getChargeStateFromMS1(ppmMerge);
vector<Isotope> isotopes = highestpeak->getScan()->getIsotopicPattern(highestpeak->peakMz,isotopeMzTolr, 6, 10);

if(isotopes.size() > 0) {
//group.chargeState = isotopes.front().charge;
for(Isotope& isotope: isotopes) {
if (mzUtils::ppmDist((float) isotope.mz, (float) group.meanMz) < isotopeMzTolr) {
group.isotopicIndex=isotope.C13;
}
}
}

if (excludeIsotopicPeaks) {
if (group.chargeState > 0 and not group.isMonoisotopic(isotopeMzTolr)) continue;
}

//if (getChargeStateFromMS1(&group) < minPrecursorCharge) continue;
//build consensus ms2 specta
//vector<Scan*>ms2events = group.getFragmenationEvents();
Expand All @@ -571,10 +555,16 @@ void BackgroundPeakUpdate::processSlices(vector<mzSlice*>&slices, string setName
continue;
}

if (!slice->srmId.empty()) group.srmId = slice->srmId;
//Issue 707: extract isotopic peaks (requires compound by this point)
group.pullIsotopes(isotopeParameters, mainwindow->getSamples());
group.isotopeParameters = isotopeParameters;
group.chargeState = group.getChargeStateFromMS1(ppmMerge);

//TODO: this is confusing, nobody is using
// group.groupRank = (1.1-group.maxQuality)*(1/log(group.maxIntensity+1));
if (excludeIsotopicPeaks) {
if (group.chargeState > 0 and not group.isMonoisotopic(isotopeMzTolr)) continue;
}

if (!slice->srmId.empty()) group.srmId = slice->srmId;

groupsToAppend.push_back(&group);
}
Expand Down

0 comments on commit 0c186d2

Please sign in to comment.