Example #1
0
        private void LoadProject()
        {
            try
            {
                DialogResult dlg = dlgOpenProject.ShowDialog();
                if (dlg != DialogResult.OK)
                {
                    return;
                }
                SetText(dlgOpenProject);
                string filename = dlgOpenProject.FileName;
                try
                {
                    OA = OPALArray.ReadFromFile(filename);
                }
                catch
                {
                    MessageBox.Show("The file may be corrupted or not a valid PeSA project file.", Analyzer.ProgramName);
                }
                thresholdEntry.SetInitialValues(OA.GetPositiveThreshold(), OA.GetNegativeThreshold());
                rbMaxValue.Checked     = OA.NormMode == NormalizationMode.Max;
                rbPerRowColumn.Checked = OA.NormMode != NormalizationMode.Max;

                cbPermutationXAxis.Checked = PermutationXAxis;
                cbYAxisTopToBottom.Checked = OA.PositionYAxisTopToBottom;

                if (OA.QuantificationMatrix != null)
                {
                    LoadQuantificationFromOPALArrayToGrid();
                }
                GridUtil.LoadNumericMatrixToGrid(dgNormalized, OA.NormalizedMatrix, 1, 1);
                FillGridHeaders(dgNormalized);

                bool gridOK = ColorGridsandDrawMotifs();//also creates/draws the motif

                eNotes.Text          = OA.Notes;
                imageReference.Image = null;
                try
                {
                    Image img = FileUtil.Base64ToImage(OA.ImageStr);
                    imageReference.Image = img;
                }
                catch { }

                DrawColorMatrix();
                if (!gridOK)
                {
                    MessageBox.Show("There is a problem in loading the file. It is highly recommended to re-run the analysis.", Analyzer.ProgramName);
                }
            }
            catch
            {
                MessageBox.Show("There is a problem in loading the file. It is highly recommended to re-run the analysis.", Analyzer.ProgramName);
            }
            linkRun.Visible = true;
        }
        private void LoadProject()
        {
            try
            {
                DialogResult dlg = dlgOpenProject.ShowDialog();
                if (dlg != DialogResult.OK)
                {
                    return;
                }
                SetText(dlgOpenProject);
                string filename = dlgOpenProject.FileName;
                PA = PermutationArray.ReadFromFile(filename);

                thresholdEntry.SetInitialValues(PA.GetPositiveThreshold(), PA.GetNegativeThreshold());

                cbWildTypeXAxis.Checked    = !PA.PermutationXAxis;
                cbYAxisTopToBottom.Checked = PA.WildTypeYAxisTopToBottom;
                colCount = PA.ColCount;
                rowCount = PA.RowCount;

                SetRowColumnCount();
                rbMeanValue.Checked    = PA.NormMode == NormalizationMode.Mean;
                rbPerRowColumn.Checked = PA.NormMode != NormalizationMode.Mean;
                if (PA.PeptideMatrix != null)
                {
                    LoadPeptidesFromPermutationArrayToGrid();
                }
                if (PA.QuantificationMatrix != null)
                {
                    LoadQuantificationFromPermutationArrayToGrid();
                }
                if (PA.NormalizedMatrix != null)
                {
                    LoadNormalizedMatrixFromPeptideArrayToGrid();
                }
                bool gridsOK = ColorGrids();
                eNotes.Text          = PA.Notes;
                imageReference.Image = null;
                try
                {
                    Image img = FileUtil.Base64ToImage(PA.ImageStr);
                    imageReference.Image = img;
                }
                catch { }
                DrawColorMatrix();
                if (!gridsOK)
                {
                    MessageBox.Show("There is a problem in loading the file. It is highly recommended to re-run the analysis.", Analyzer.ProgramName);
                }
            }
            catch
            {
                MessageBox.Show("There is a problem in loading the file. It is highly recommended to re-run the analysis.", Analyzer.ProgramName);
            }
            linkRun.Visible = true;
        }
Example #3
0
        private void btnLoad_Click(object sender, EventArgs e)
        {
            try
            {
                DialogResult dlg = dlgOpenProject.ShowDialog();
                if (dlg != DialogResult.OK)
                {
                    return;
                }
                SetText(dlgOpenProject);
                string filename = dlgOpenProject.FileName;
                try
                {
                    PA = PeptideArray.ReadFromFile(filename);
                }
                catch
                {
                    MessageBox.Show("The file may be corrupted or not a valid PeSA project file.", Analyzer.ProgramName);
                }
                peptidelength       = PA.PeptideLength;
                ePeptideLength.Text = peptidelength.ToString();
                rowsFirst           = PA.RowsFirst;
                colCount            = PA.ColCount;
                rowCount            = PA.RowCount;
                UpdateArrayInfo();

                eNormalizeBy.Text = PA.NormalizationValue.ToString();

                thresholdEntry.SetInitialValues(PA.GetPositiveThreshold(), PA.GetNegativeThreshold());

                eFreqThreshold.Text = PA.FrequencyThreshold.ToString();
                eAminoAcid.Text     = PA.KeyAA.ToString();
                eKeyPosition.Text   = PA.KeyPosition?.ToString() ?? "";
                SetRowColumnCount();
                if (PA.PeptideMatrix != null)
                {
                    LoadPeptidesFromPeptideArrayToGrid();
                }
                if (PA.QuantificationMatrix != null)
                {
                    LoadQuantificationFromPeptideArrayToGrid();
                }
                if (PA.NormalizedMatrix != null)
                {
                    LoadNormalizedMatrixFromPeptideArrayToGrid();
                }
                bool gridsOK = ColorGrids();
                eNotes.Text          = PA.Notes;
                imageReference.Image = null;
                try
                {
                    Image img = FileUtil.Base64ToImage(PA.ImageStr);
                    imageReference.Image = img;
                }
                catch { }
                if (!gridsOK)
                {
                    MessageBox.Show("There is a problem in loading the file. It is highly recommended to re-run the analysis.", Analyzer.ProgramName);
                }
            }
            catch
            {
                MessageBox.Show("There is a problem in loading the file. It is highly recommended to re-run the analysis.", Analyzer.ProgramName);
            }
            linkRun.Visible = true;
        }