예제 #1
0
파일: PSM.cs 프로젝트: trishorts/Compass
 public QuantPeak this[TagInformation tag]
 {
     get
     {
         return(QuantPeaks[tag.UniqueTagNumber]);
     }
 }
예제 #2
0
 public QuantPeak(TagInformation tag, IPeak peak, double injectionTime, MsnDataScan scan, double noise = 0, bool isNoiseCapped = false)
 {
     Tag = tag;
     if (peak == null)
     {
         RawIntensity = 0;
         MZ           = 0;
     }
     else
     {
         RawIntensity = peak.Y;
         MZ           = peak.X;
     }
     //DataScan = scan;
     InjectionTime  = injectionTime;
     Noise          = noise;
     IsNoisedCapped = isNoiseCapped;
 }
예제 #3
0
        private void BuildPurityMatrixes(IEnumerable <TagInformation> inputTags)
        {
            List <TagInformation> tags = inputTags.ToList();

            Log("\n== Purity Correction Matrices ==");
            OnUpdateLog("Building Purity Matrices");
            PurityMatrices = new Dictionary <TagSetType, IsobaricTagPurityCorrection>();
            foreach (TagSetType tagSet in Enum.GetValues(typeof(TagSetType)))
            {
                List <TagInformation> usedTags = tags.Where(t => t.TagSet == tagSet).ToList();
                if (usedTags.Count <= 0)
                {
                    continue;
                }
                usedTags = usedTags.OrderBy(t => t.NominalMass).ToList();
                int max    = usedTags[usedTags.Count - 1].NominalMass - usedTags[0].NominalMass + 1;
                int minint = usedTags[0].NominalMass;

                TagInformation[] tarray = new TagInformation[max];
                double[,] data = new double[max, 4];

                foreach (var tag in usedTags)
                {
                    tarray[tag.NominalMass - minint] = tag;
                }

                for (int i = 0; i < max; i++)
                {
                    var tag = tarray[i];
                    if (tag != null)
                    {
                        data[i, 0] = tag.M2;
                        data[i, 1] = tag.M1;
                        data[i, 2] = tag.P1;
                        data[i, 3] = tag.P2;
                    }
                    else
                    {
                        for (int j = 0; j < 4; j++)
                        {
                            data[i, j] = 0;
                        }
                    }
                }
                IsobaricTagPurityCorrection correction = IsobaricTagPurityCorrection.Create(data);
                OnUpdateLog("Purity Matrix for " + tagSet + " complete");
                Log("Tag SetSite:\t" + tagSet);
                Log("Input Matrix");
                for (int i = 0; i < max; i++)
                {
                    Log(string.Format("\t{0:F1}\t{1:F1}\t{2:F1}\t{3:F1}", data[i, 0], data[i, 1], data[i, 2], data[i, 3]));
                }
                Log("\nPurity Matrix");
                double[,] purityMatrix = correction.GetMatrix();
                for (int i = 0; i < purityMatrix.GetLength(0); i++)
                {
                    StringBuilder sb = new StringBuilder("\t");
                    for (int j = 0; j < purityMatrix.GetLength(1); j++)
                    {
                        sb.AppendFormat("{0:f3}", purityMatrix[i, j]);
                        sb.Append('\t');
                    }
                    sb.Remove(sb.Length - 1, 1);
                    Log(sb.ToString());
                }
                Log("");
                PurityMatrices.Add(tagSet, correction);
            }
        }