public IsotopicProfile CloneIsotopicProfile() { var iso = new IsotopicProfile(); iso.AverageMass = AverageMass; iso.ChargeState = ChargeState; iso.IntensityMostAbundant = IntensityMostAbundant; iso.IntensityMostAbundantTheor = IntensityMostAbundantTheor; iso.MonoIsotopicMass = MonoIsotopicMass; iso.MonoIsotopicPeakIndex = MonoIsotopicPeakIndex; iso.MonoPeakMZ = MonoPeakMZ; iso.MonoPlusTwoAbundance = MonoPlusTwoAbundance; iso.MostAbundantIsotopeMass = MostAbundantIsotopeMass; iso.IsSaturated = IsSaturated; iso.OriginalIntensity = OriginalIntensity; iso.Peaklist = new List <MSPeak>(); foreach (var mspeak in Peaklist) { var peak = new MSPeak(mspeak.XValue, mspeak.Height, mspeak.Width, mspeak.SignalToNoise); iso.Peaklist.Add(peak); } iso.Score = Score; iso.ScoreCountBasis = ScoreCountBasis; return(iso); }
public override double GetRatio(double[] xvals, double[] yvals, DeconTools.Backend.Core.IsotopicProfile iso1, DeconTools.Backend.Core.IsotopicProfile iso2, double backgroundIntensity) { double returnVal = -1; returnVal = GetRatioBasedOnAreaUnderPeaks(xvals, yvals, iso1, iso2, backgroundIntensity); return(returnVal); }
public double GetRatioBasedOnMostIntensePeak(DeconTools.Backend.Core.IsotopicProfile iso1, DeconTools.Backend.Core.IsotopicProfile iso2) { double returnVal = -1; if (iso1 == null || iso2 == null) { return(returnVal); } double iso1MaxIntens = iso1.getMostIntensePeak().Height; double iso2MaxIntens = iso2.getMostIntensePeak().Height; return(returnVal); }
public double GetRatioBasedOnAreaUnderPeaks(double[] xvals, double[] yvals, DeconTools.Backend.Core.IsotopicProfile iso1, DeconTools.Backend.Core.IsotopicProfile iso2, double backgroundIntensity) { double returnRatio = -1; //define starting m/z value based on peak m/z and width var leftMostMZ = iso1.Peaklist[0].XValue - 1; // 4σ = peak width at base; '-1' ensures we are starting outside the peak. //find starting point (use binary search) var indexOfStartingPoint = Utilities.MathUtils.BinarySearchWithTolerance(xvals, leftMostMZ, 0, xvals.Length - 1, 0.1); if (indexOfStartingPoint == -1) { indexOfStartingPoint = 0; } var area1 = IsotopicProfileUtilities.CalculateAreaOfProfile(iso1, xvals, yvals, backgroundIntensity, ref indexOfStartingPoint); var area2 = IsotopicProfileUtilities.CalculateAreaOfProfile(iso2, xvals, yvals, backgroundIntensity, ref indexOfStartingPoint); if (area1 < 0) { area1 = 0; } if (area2 > 0) { returnRatio = area1 / area2; } else { returnRatio = 9999; // this will indicate the problem of the second isotope having a 0 or negative area. } return(returnRatio); //iterate over peaks from isotopic profile 1 //iterate over raw m/z values. //If within peak m/z range, calculate area (trapazoid) //repeat the above with isotopic profile 2 }
protected string buildBasicConsoleInfo() { var sb = new StringBuilder(); sb.Append("****** Match ******\n"); sb.Append("NET = \t" + Target.NormalizedElutionTime.ToString("0.000") + "\n"); sb.Append("ChromPeak ScanNum = " + ChromPeakSelected.XValue.ToString(CultureInfo.InvariantCulture) + "\n"); sb.Append("ChromPeak NETVal = " + ChromPeakSelected.NETValue.ToString("0.000") + "\n"); sb.Append("ScanSet = { "); foreach (var scanNum in ScanSet.IndexValues) { sb.Append(scanNum); sb.Append(", "); } sb.Append("} \n"); if (IsotopicProfile?.Peaklist != null && IsotopicProfile.Peaklist.Count > 0) { sb.Append("Observed MZ and intensity = " + IsotopicProfile.getMonoPeak().XValue + "\t" + IsotopicProfile.getMonoPeak().Height + "\n"); } sb.Append("FitScore = " + Score.ToString("0.0000") + "\n"); return(sb.ToString()); }
internal virtual void AddTheoreticalLabelledIsotopicProfile(IsotopicProfile theorLabelledIso) { throw new NotImplementedException(); }
internal virtual void AddLabelledIso(IsotopicProfile labelledIso) { throw new NotImplementedException(); }
public abstract double GetRatio(double[] xvals, double[] yvals, DeconTools.Backend.Core.IsotopicProfile iso1, DeconTools.Backend.Core.IsotopicProfile iso2, double backgroundIntensity);
protected TargetedResultBase(TargetBase target) { Target = target; IsotopicProfile = new IsotopicProfile(); ChromPeakQualityList = new List <ChromPeakQualityData>(); }
internal override void AddTheoreticalLabelledIsotopicProfile(IsotopicProfile theorLabelledIso) { this.TheorIsotopicProfileLabeled = theorLabelledIso; }
internal override void AddLabelledIso(IsotopicProfile labelledIso) { this.IsotopicProfileLabeled = labelledIso; }