Пример #1
0
        static void Main(string[] args)
        {
            if (args.Length == 0)
            {
                MainForm mf = new MainForm();
                //mf.ShowDialog();
                return;
            }
            FileInfo file;

            file = new FileInfo(args[0]);

            RawReaderParams readerParams = new RawReaderParams();

            readerParams.LoadDefaults();

            Reader reader = new Reader(readerParams);

            List <MSLight> allSpectra = reader.GetSpectra(file.FullName, new List <int>(), false);

            if (readerParams.ExtractMS1)
            {
                List <MSLight> msPrint = allSpectra.FindAll(a => a.ActivationType.Equals(""));
                SpectraPrinter.PrintFile(file, msPrint, ".ms1", readerParams);
            }

            if (readerParams.ExtractMS2)
            {
                List <MSLight> msPrint = allSpectra.FindAll(a => !a.ActivationType.Equals(""));
                SpectraPrinter.PrintFile(file, msPrint, ".ms2", readerParams);
            }
        }
Пример #2
0
        private void buttonExtract_Click(object sender, EventArgs e)
        {
            richTextBoxMS.Clear();
            RawReaderParams myParams = new RawReaderParams();

            myParams.LoadDefaults();

            Reader r = new Reader(myParams);

            List <MSLight> theMS = r.GetSpectra(studyFile.FullName, new List <int>()
            {
                (int)numericUpDownSpectrumNumber.Value
            }, false);

            List <Ion> theIons = new List <Ion>();

            for (int i = 0; i < theMS[0].MZ.Count; i++)
            {
                theIons.Add(new Ion(theMS[0].MZ[i], theMS[0].Intensity[i], 0, 0));
            }


            foreach (Ion i in theIons)
            {
                richTextBoxMS.AppendText(i.MZ + " " + i.Intensity + "\n");
            }
        }