Exemplo n.º 1
0
        private void buttonXtract_Click(object sender, EventArgs e)
        {
            if (textBoxScanNo.Text.Length == 0)
            {
                MessageBox.Show("Please enter a valid scan number");
                return;
            }
            double theoreticalMH = double.Parse(textBoxTheoreticalMass.Text);
            int    scanNo        = int.Parse(textBoxScanNo.Text);

            SQTLight s = new SQTLight(null);

            s.PeptideSequenceCleaned = "N/A";
            XQuantClusteringParameters myParams = parameters1.GetFromScreen();

            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();
            Dictionary <string, List <Quant> > theQuants = Core35.Quant(getter, s, theoreticalMH, isotopicSignal, scanNo, myParams);

            stopwatch.Stop();
            Console.WriteLine("Time elapsed: {0}", stopwatch.Elapsed);

            foreach (var kvp in theQuants)
            {
                foreach (Quant q in kvp.Value)
                {
                    //XICViewer viewer = new XICViewer();

                    //viewer.Plot(q.PrecursorMZ, q.GetIonsLight(), new List<int>() { q.ScanNoMS2 });
                    //viewer.ShowDialog();
                }
            }
        }
Exemplo n.º 2
0
        public static Dictionary <string, List <Quant> > Quant(XICGet5 xic, SQTLight theScn, double theoreticalMH, SignalGenerator isotopicSignal, int scnNo, XQuantClusteringParameters myParams)
        {
            Dictionary <string, List <Quant> > theResults = new Dictionary <string, List <Quants.Quant> >();

            //We will obtain the isotopic signal and obtain the XIC according to the most intense isotope
            List <double> isoSignal            = isotopicSignal.GetSignal(5, theoreticalMH, 0);
            int           maximumSignalIsotope = isoSignal.IndexOf(isoSignal.Max());


            foreach (int z in myParams.AcceptableChargeStates)
            {
                double pMass = ((double)z - 1.0) * 1.007276466;
                double iMass = (maximumSignalIsotope * 1.00335);
                double mz    = (theoreticalMH + pMass + iMass) / (double)z;

                double[,] ic = xic.GetXIC3(Math.Round(mz, 4), myParams.ClusteringPPM, scnNo);

                if (ic != null)
                {
                    Quant q = new Quants.Quant(ic, theScn.ScanNumber, z, Math.Round(mz, 4));

                    if (theResults.ContainsKey(theScn.PeptideSequenceCleaned))
                    {
                        theResults[theScn.PeptideSequenceCleaned].Add(q);
                    }
                    else
                    {
                        theResults.Add(theScn.PeptideSequenceCleaned, new List <Quants.Quant>()
                        {
                            q
                        });
                    }
                }
            }

            return(theResults);
        }