public Feature(MZPeak firstPeak, double RT, double HCDEnergy = 0) { this.allRTPeaks = new List <RTPeak>(); this.smoothRTPeaks = new List <RTPeak>(); this.minRT = RT; this.maxRT = RT; RTPeak newRTPeak = new RTPeak(firstPeak, RT); this.allRTPeaks.Add(newRTPeak); this.maxPeak = newRTPeak; this.totalMZTimesIntensity += (firstPeak.Intensity * firstPeak.MZ); this.totalIntensity += (firstPeak.Intensity); this.averageMZ = firstPeak.MZ; newRTPeak.HCDEnergy = HCDEnergy; }
public void AddSmoothPeak(RTPeak peak) { this.smoothRTPeaks.Add(peak); if (this.maxPeak == null) { this.maxPeak = peak; } if (peak.Intensity > this.maxPeak.Intensity) { this.maxPeak = peak; } this.totalMZTimesIntensity += (peak.Intensity * peak.MZ); this.totalIntensity += (peak.Intensity); this.averageMZ = (this.totalMZTimesIntensity / this.totalIntensity); }
public void AddPeak(MZPeak peak, double RT, double HCDEnergy = 0) { RTPeak newRTPeak = new RTPeak(peak, RT); this.allRTPeaks.Add(newRTPeak); if (peak.Intensity > maxPeak.Intensity) { apexTime = RT; maxPeak = newRTPeak; } this.maxRT = RT; this.totalMZTimesIntensity += (peak.Intensity * peak.MZ); this.totalIntensity += (peak.Intensity); this.averageMZ = (this.totalMZTimesIntensity / this.totalIntensity); newRTPeak.HCDEnergy = HCDEnergy; }
public void AddPeak(RTPeak peak) { this.allRTPeaks.Add(peak); if (maxPeak == null) { MaxPeak = peak; } if (peak.Intensity > maxPeak.Intensity) { apexTime = peak.RT; maxPeak = peak; } this.maxRT = peak.RT; this.totalMZTimesIntensity += (peak.Intensity * peak.MZ); this.totalIntensity += (peak.Intensity); this.averageMZ = (this.totalMZTimesIntensity / this.totalIntensity); }
public static List <RTPeak> ConvertFeatureStringToPeakList(string featureString) { List <RTPeak> returnList = new List <RTPeak>(); string[] parts = featureString.Split(';'); foreach (var part in parts) { if (!string.IsNullOrEmpty(part)) { string[] subparts = part.Split(','); double rt = double.Parse(subparts[0]); double intensity = double.Parse(subparts[1]); var newRTPeak = new RTPeak(); newRTPeak.RT = rt; newRTPeak.Intensity = intensity; returnList.Add(newRTPeak); } } return(returnList); }
public bool Equals(RTPeak obj) { return(obj is RTPeak && Equals((RTPeak)obj)); }
public int CompareTo(Object other) { RTPeak otherPeak = (RTPeak)other; return(RT.CompareTo(otherPeak.RT)); }
public int CompareTo(RTPeak other) { return(RT.CompareTo(other.RT)); }