Exemplo n.º 1
0
        private void linkLoadFromFile_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            try
            {
                DialogResult dlg = dlgOpenQuantification.ShowDialog();
                if (dlg != DialogResult.OK)
                {
                    return;
                }
                SetText(dlgOpenProject);
                string filename = dlgOpenQuantification.FileName;

                if (System.IO.File.Exists(filename))
                {
                    OA = FileUtil.ReadOPALArrayQuantificationData(filename);
                    thresholdEntry.SetInitialValues(OA.GetPositiveThreshold(), OA.GetNegativeThreshold());

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

                    if (OA.QuantificationMatrix != null)
                    {
                        LoadQuantificationFromOPALArrayToGrid();
                    }
                    GridUtil.LoadNumericMatrixToGrid(dgNormalized, OA.NormalizedMatrix, 1, 1);
                    FillGridHeaders(dgNormalized);
                    Run();
                    ColorGridsandDrawMotifs();
                }
            }
            catch
            {
                MessageBox.Show("There is a problem with loading the quantification file.\r\nPlease make sure the quantification data is the only data in the loaded file.\r\n", Application.ProductName);
            }
        }
Exemplo n.º 2
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;
        }