Exemplo n.º 1
0
 private void thresholdEntry_ThresholdChanged(object sender, EventArgs e)
 {
     if (OA == null)
     {
         return;
     }
     OA.SetPositiveThreshold(thresholdEntry.PositiveThreshold, out bool negChanged);
     OA.SetNegativeThreshold(thresholdEntry.NegativeThreshold, out bool posChanged2);
     ColorGridsandDrawMotifs();
     mdMatrix.SetThreshold(OA.PositiveThreshold, OA.NegativeThreshold);
 }
Exemplo n.º 2
0
        private void Run()
        {
            string[,] values = new string[dgQuantification.RowCount, dgQuantification.ColumnCount];
            for (int iRow = 0; iRow < dgQuantification.RowCount; iRow++)
            {
                for (int iCol = 0; iCol < dgQuantification.ColumnCount; iCol++)
                {
                    values[iRow, iCol] = dgQuantification[iCol, iRow].Value?.ToString() ?? "";
                }
            }

            string error = "";
            bool   xPossible = true, yPossible = true;

            OPALArray.CheckPermutationAxis(values, ref xPossible, ref yPossible);
            if (xPossible && yPossible)
            {
                PermutationXAxis = cbPermutationXAxis.Checked;
            }
            else if (xPossible)
            {
                PermutationXAxis           = true;
                cbPermutationXAxis.Checked = true;
            }
            else if (yPossible)
            {
                PermutationXAxis           = false;
                cbPermutationXAxis.Checked = false;
            }
            if (!xPossible && !yPossible)
            {
                MessageBox.Show("Please make sure one the axes have OPAL array (each amino acid has to exist at most once)", Analyzer.ProgramName);
                return;
            }
            ;
            OA = new OPALArray(values, PermutationXAxis, cbYAxisTopToBottom.Checked, out error);
            OA.SetPositiveThreshold(thresholdEntry.PositiveThreshold, out bool negChanged);
            OA.SetNegativeThreshold(thresholdEntry.NegativeThreshold, out bool posChanged2);
            if (error != "")
            {
                MessageBox.Show(error, Analyzer.ProgramName);
                return;
            }
            GridUtil.LoadNumericMatrixToGrid(dgNormalized, OA.NormalizedMatrix, 1, 1);
            FillGridHeaders(dgNormalized);
            ColorGridsandDrawMotifs();
            DrawColorMatrix();
        }