Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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;
        }
Exemplo n.º 4
0
 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);
 }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
 public bool Equals(RTPeak obj)
 {
     return(obj is RTPeak && Equals((RTPeak)obj));
 }
Exemplo n.º 7
0
        public int CompareTo(Object other)
        {
            RTPeak otherPeak = (RTPeak)other;

            return(RT.CompareTo(otherPeak.RT));
        }
Exemplo n.º 8
0
 public int CompareTo(RTPeak other)
 {
     return(RT.CompareTo(other.RT));
 }