public RapidDeconvolutor(double minPeptideToBackgroundRatio, DeconResultComboMode comboMode) { this.minPeptideToBackgroundRatio = minPeptideToBackgroundRatio; this.resultCombiningMode = comboMode; this.IsNewFitCalculationPerformed = true; this.fitScoreCalculator = new DeconTools.Backend.ProcessingTasks.FitScoreCalculators.DeconToolsFitScoreCalculator(); this.targetedFeatureFinder = new BasicTFF(); }
protected void AddDeconResult(ResultCollection baseResultList, IsosResult addedResult, DeconResultComboMode comboMode = DeconResultComboMode.simplyAddIt) { Check.Require(baseResultList != null, "Deconvolutor problem. Can't combine results. Base resultList is null."); if (baseResultList == null) { return; } Check.Require(addedResult != null, "Deconvolutor problem. Can't combine results. Added IsosResult is null."); switch (comboMode) { case DeconResultComboMode.simplyAddIt: baseResultList.AddIsosResult(addedResult); break; case DeconResultComboMode.addItIfUnique: //retrieve IsosResults for CurrentScanSet //TODO: next line might be a time bottleneck! needs checking //List<IsosResult> scanSetIsosResults = ResultCollection.GetIsosResultsForCurrentScanSet(baseResultList); //search isosResults for a (monoPeak = addedResult's monoPeak) AND chargeState = addedResult's chargeState if (doesResultExist(baseResultList.IsosResultBin, addedResult)) { //do nothing... isotopic profile already exists } else { baseResultList.AddIsosResult(addedResult); } break; case DeconResultComboMode.addAndReplaceIfOneDaltonErrorDetected: throw new NotImplementedException("add and replace isotopic profile mode not yet supported"); } }
public RapidDeconvolutor(DeconResultComboMode comboMode) : this(5, comboMode) { }
private void GenerateResults(ResultCollection resultList, ref int[] chargeResults, ref double[] intensityResults, ref double[] mzResults, ref double[] scoreResults, ref double[] avgmassResults, ref double[] massResults, ref double[] mostAbundantMassResults, DeconResultComboMode comboMode) { ScanSet currentScanset; if (resultList.Run is UIMFRun) { currentScanset = ((UIMFRun)resultList.Run).CurrentIMSScanSet; } else { currentScanset = resultList.Run.CurrentScanSet; } currentScanset.NumIsotopicProfiles = 0; //reset to 0; for (int i = 0; i < chargeResults.Length; i++) { if (chargeResults[i] == 0) { continue; } double rapidScore = scoreResults[i]; if ((float)rapidScore == 0.9999999999999f) { continue; // this is an oddity about the Rapid results. For very poor or immeasurable scores, it will give a score of 1.000000000; } IsosResult result = resultList.CreateIsosResult(); result.IntensityAggregate = intensityResults[i]; IsotopicProfile profile = new IsotopicProfile(); profile.ChargeState = chargeResults[i]; profile.Score = scoreResults[i]; MSPeak monoPeak = new MSPeak(); monoPeak.XValue = ConvertMassToMZ(massResults[i], profile.ChargeState); //TODO: make it so that the entire isotopic profile peak list is populated. Right now, just the monoisotopic peak is found. GetIsotopicProfilePeaks(resultList.Run.PeakList, profile.ChargeState, monoPeak.XValue, ref profile); if (profile.Peaklist.Count == 0) // couldn't find original monoIsotopicPeak in the peaklist { //So first check and see if it is the most abundant peak (mzResults returns the mz for the most abundant peak); get the m/z from there (This m/z matches with DeconTools peaklist m/z values) if (Math.Abs(monoPeak.XValue - mzResults[i]) < (1 / profile.ChargeState - 1 / profile.ChargeState * 0.2)) { monoPeak.XValue = mzResults[i]; profile.Peaklist = new List <MSPeak>(); profile.Peaklist.Add(monoPeak); } else // happens if the mono peak is not the most abundant peak. Will have to use Rapid's calculated value for the mono peak { profile.Peaklist = new List <MSPeak>(); profile.Peaklist.Add(monoPeak); } } double mostabundantPeakMZ = mzResults[i]; //Console.WriteLine("mostAbundantPeakMZ = " + mostabundantPeakMZ); //Console.WriteLine("calculated mostAbundantMZ = " + ConvertMassToMZ(mostAbundantMassResults[i], profile.ChargeState)); profile.MonoIsotopicMass = massResults[i]; profile.MostAbundantIsotopeMass = mostAbundantMassResults[i]; profile.AverageMass = avgmassResults[i]; profile.MonoPeakMZ = profile.GetMZ(); result.IsotopicProfile = profile; //resultList.ResultList.Add(result); this.AddDeconResult(resultList, result, comboMode); currentScanset.NumIsotopicProfiles++; } }