Exemple #1
0
        public static Core20Paired Deserialize(string fileName)
        {
            Stream          stream     = File.Open(fileName, FileMode.Open);
            BinaryFormatter bformatter = new BinaryFormatter();
            Core20Paired    corePaired = (Core20Paired)bformatter.Deserialize(stream);

            stream.Close();
            return(corePaired);
        }
        private void xICCoreToolStripMenuItem_Click(object sender, EventArgs e)
        {
            openFileDialog1.Filter = "XIC files (*.xic)|*.xic";

            if (openFileDialog1.ShowDialog() != System.Windows.Forms.DialogResult.Cancel)
            {
                coreP = new PairAnalyzer.Core20Paired(openFileDialog1.FileName, checkBoxInvertClasses.Checked);
                FinishLoadingProcedures();
                buttonRunAnalysis.Enabled = true;
                MessageBox.Show("File loaded.");
            }

            checkBoxInvertClasses.Enabled = false;
        }
        private void pairedAnalysisToolStripMenuItem_Click(object sender, EventArgs e)
        {
            openFileDialog1.Filter   = "Paired files (*.paired)|*.paired|All files(*.*)|*.*";
            openFileDialog1.FileName = "";

            if (openFileDialog1.ShowDialog() != DialogResult.Cancel)
            {
                buttonProteinReport.Enabled = true;
                buttonRunAnalysis.Enabled   = true;

                coreP = Core20Paired.Deserialize(openFileDialog1.FileName);
                PrintPeptideAnalysis(coreP.AcceptableClasses);
                PrintProteinReport();

                foreach (int theClass in coreP.core.myQuantPkgs.Select(a => a.ClassLabel).Distinct().ToList())
                {
                    checkedListBoxClasses.Items.Add(theClass);
                }

                for (int i = 0; i < checkedListBoxClasses.Items.Count; i++)
                {
                    if (coreP.AcceptableClasses.Contains(int.Parse(checkedListBoxClasses.Items[i].ToString())))
                    {
                        checkedListBoxClasses.SetItemCheckState(i, CheckState.Checked);
                    }
                    else
                    {
                        checkedListBoxClasses.SetItemCheckState(i, CheckState.Unchecked);
                    }
                }
            }

            checkBoxInvertClasses.Checked      = coreP.InvertClasses;
            checkBoxNormalize.Checked          = coreP.NormalizeTIC;
            checkBoxOnlyUniquePeptides.Checked = coreP.OnlyUniquePeptides;
            numericUpDownMinMS1COunt.Value     = coreP.MinMS1Count;
            numericUpDownMinPeptideFold.Value  = (decimal)coreP.MinFold;
        }