public void getGaussianPeakTest1()
        {
            MassTag mt = new MassTag();

            mt.ID = 56488;
            mt.MonoIsotopicMass = 2275.1694779;
            mt.PeptideSequence  = "TTPSIIAYTDDETIVGQPAKR";
            mt.NETVal           = 0.3520239f;
            mt.CreatePeptideObject();
            mt.ChargeState = 2;

            Run run = new XCaliburRun();

            ResultCollection rc = new ResultCollection(run);

            rc.Run.CurrentMassTag = mt;

            Task theorGen = new TomTheorFeatureGenerator();

            theorGen.Execute(rc);

            mt.CalculateMassesForIsotopicProfile(mt.ChargeState);

            TestUtilities.DisplayIsotopicProfileData(mt.IsotopicProfile);
            XYData xydata = TheorXYDataCalculationUtilities.GetTheorPeakData(mt.IsotopicProfile.Peaklist[1], 0.007);

            TestUtilities.DisplayXYValues(xydata);
        }
        private XYData GetTheoreticalIsotopicProfileXYData(IsotopicProfile iso, double fwhm, double minRelIntensity)
        {
            var xydata = new XYData();
            var xvals  = new List <double>();
            var yvals  = new List <double>();


            var mspeaks = new List <MSPeak>(iso.Peaklist);

            var zeroIntensityPeakToTheLeft = new MSPeak();

            zeroIntensityPeakToTheLeft.XValue = iso.Peaklist[0].XValue - 1 * 1.00235 / iso.ChargeState;
            zeroIntensityPeakToTheLeft.Height = 0;

            mspeaks.Insert(0, zeroIntensityPeakToTheLeft);

            //TheorXYDataCalculationUtilities.GetTheoreticalIsotopicProfileXYData()


            for (var peakIndex = 0; peakIndex < mspeaks.Count; peakIndex++)
            {
                var msPeak     = mspeaks[peakIndex];
                var tempXYData = TheorXYDataCalculationUtilities.GetTheorPeakData(msPeak, fwhm, NumPointsPerTheorPeak);

                for (var j = 0; j < tempXYData.Xvalues.Length; j++)
                {
                    //First peak is a zero-intensity peak. We always want to add that one. For the others,
                    //add intensity points that are above a certain intensity
                    if (peakIndex > 0)
                    {
                        if (tempXYData.Yvalues[j] >= minRelIntensity)
                        {
                            xvals.Add(tempXYData.Xvalues[j]);
                            yvals.Add(tempXYData.Yvalues[j]);
                        }
                    }
                    else
                    {
                        xvals.Add(tempXYData.Xvalues[j]);
                        yvals.Add(tempXYData.Yvalues[j]);
                    }
                }
            }
            xydata.Xvalues = xvals.ToArray();
            xydata.Yvalues = yvals.ToArray();



            return(xydata);
        }
Exemple #3
0
 public XYData GetTheorPeakData(double fwhm, int numPointsPerPeak)
 {
     return(TheorXYDataCalculationUtilities.GetTheorPeakData(XValue, Height, fwhm, numPointsPerPeak));
 }