Exemplo n.º 1
0
        private void ftestdescBasedToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (checkedListBoxActiveDescriptors.CheckedItems.Count <= 1)
            {
                MessageBox.Show("At least two descriptors have to be selected", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            cDesignerTab DT = new cDesignerTab();

            cTwoSampleFTest CM = new cTwoSampleFTest();
            CM.FTestTails = eFTestTails.BOTH;

            if (this.ProcessModeplateByPlateToolStripMenuItem.Checked)
            {
                foreach (cPlate TmpPlate in cGlobalInfo.CurrentScreening.ListPlatesActive)
                {
                    cListWells ListWellsToProcess = new cListWells(null);
                    foreach (cWell item in TmpPlate.ListActiveWells)
                        if (item.GetCurrentClassIdx() != -1) ListWellsToProcess.Add(item);

                    cExtendedTable NewTable = new cExtendedTable(ListWellsToProcess, true);


                    CM.SetInputData(NewTable);
                    CM.Run();

                    cViewerHeatMap VHM = new cViewerHeatMap();
                    VHM.SetInputData(CM.GetOutPut());
                    VHM.IsDisplayValues = true;
                    VHM.Title = "F-Test - " + TmpPlate.GetName() + " (" + ListWellsToProcess.Count + " wells)";
                    VHM.Run();

                    DT.SetInputData(VHM.GetOutPut());
                }
            }
            else if (this.ProcessModeEntireScreeningToolStripMenuItem.Checked)
            {
                cListWells ListWellsToProcess = new cListWells(null);

                foreach (cPlate TmpPlate in cGlobalInfo.CurrentScreening.ListPlatesActive)
                {
                    foreach (cWell item in TmpPlate.ListActiveWells)
                        if (item.GetCurrentClassIdx() != -1) ListWellsToProcess.Add(item);
                }

                cExtendedTable NewTable = new cExtendedTable(ListWellsToProcess, true);

                //  cTwoSampleFTest CM = new cTwoSampleFTest();
                CM.SetInputData(NewTable);
                CM.Run();

                cViewerHeatMap VHM = new cViewerHeatMap();
                VHM.SetInputData(CM.GetOutPut());
                VHM.IsDisplayValues = true;
                VHM.Title = "F-Test - Entire screening (" + ListWellsToProcess.Count + " wells)";
                VHM.Run();

                DT.SetInputData(VHM.GetOutPut());
            }
            else
            {
                cListWells ListWellsToProcess = new cListWells(null);

                foreach (cWell item in cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().ListActiveWells)
                    if (item.GetCurrentClassIdx() != -1) ListWellsToProcess.Add(item);

                cExtendedTable NewTable = new cExtendedTable(ListWellsToProcess, true);

                // cTwoSampleFTest CM = new cTwoSampleFTest();
                CM.SetInputData(NewTable);
                CM.Run();

                cViewerHeatMap VHM = new cViewerHeatMap();
                VHM.SetInputData(CM.GetOutPut());
                VHM.IsDisplayValues = true;
                VHM.Title = "F-Test - " + cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().GetName() + " (" + ListWellsToProcess.Count + " wells)";
                VHM.Run();

                DT.SetInputData(VHM.GetOutPut());
            }

            DT.Run();
            cDisplayToWindow vD = new cDisplayToWindow();
            vD.SetInputData(DT.GetOutPut());
            vD.Title = "F-Test";
            vD.Run();
            vD.Display();
        }
Exemplo n.º 2
0
        private void PerformTestType(eTestType TestType)
        {

            #region extract classes of interest
            cGUI_ListClasses GUI_ListClasses = new cGUI_ListClasses();
            GUI_ListClasses.IsCheckBoxes = !_DescEvolCellByCellItem.Checked;
            GUI_ListClasses.IsSelectAll = true;

            if (GUI_ListClasses.Run().IsSucceed == false) return;
            cExtendedTable ListClassSelected = GUI_ListClasses.GetOutPut();

            if (ListClassSelected.Sum() < 1)
            {
                MessageBox.Show("At least one classe has to be selected.", "Error !", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            #endregion

            cDesignerTab DT = new cDesignerTab();

            for (int i = 0; i < cGlobalInfo.CurrentScreening.ListDescriptors.Count; i++)
            {

                if (cGlobalInfo.CurrentScreening.ListDescriptors[i].IsActive() == false) continue;

                cDesignerSplitter DS = new cDesignerSplitter();
                DS.Orientation = Orientation.Vertical;
                cViewerTable VTable = new cViewerTable();

                cViewertext VT = new cViewertext();

                cExtendedTable FinalTable = new cExtendedTable(cGlobalInfo.ListWellClasses.Count, 0, 0);
                for (int j = 0; j < cGlobalInfo.ListWellClasses.Count; j++)
                {
                    FinalTable[j].Tag = cGlobalInfo.ListWellClasses[j];
                    FinalTable[j].Name = cGlobalInfo.ListWellClasses[j].Name;
                }

                cListWells ListWellsToProcess = new cListWells(null);
                cDescriptorType CurrentDesc = cGlobalInfo.CurrentScreening.ListDescriptors[i];
                // build the table
                foreach (cPlate CurrentPlate in cGlobalInfo.CurrentScreening.ListPlatesActive)
                {
                    foreach (cWell CurrentWell in CurrentPlate.ListActiveWells)
                    {
                        if ((CurrentWell.GetCurrentClassIdx() < 0) || (ListClassSelected[0][CurrentWell.GetCurrentClassIdx()] == 0)) continue;
                        {
                            FinalTable[CurrentWell.GetCurrentClassIdx()].Add(CurrentWell.GetAverageValue(CurrentDesc));
                            ListWellsToProcess.Add(CurrentWell);
                        }
                    }
                }

                cClean C = new cClean();
                C.SetInputData(FinalTable);
                C.Run();
                cExtendedTable NewTable = C.GetOutPut();

                cTwoSampleFTest TSFTest = null;
                cANOVA Anova = null;
                cTwoSampleUnpooledTTest TwoSampleTTest = null;
                cStudent_tTest StudentTTest = null;

                if (TestType == eTestType.F_TEST)
                {
                    TSFTest = new cTwoSampleFTest();
                    TSFTest.SetInputData(NewTable);
                    TSFTest.Run();
                    VTable.SetInputData(TSFTest.GetOutPut());
                    VT.SetInputData(TSFTest.GetInfo());
                }
                else if (TestType == eTestType.ANOVA)
                {
                    Anova = new cANOVA();
                    Anova.SetInputData(NewTable);
                    Anova.Run();
                    VTable.SetInputData(Anova.GetOutPut());
                    VT.SetInputData(Anova.GetInfo());
                }
                else if (TestType == eTestType.TWO_SAMPLES_T_TEST)
                {
                    TwoSampleTTest = new cTwoSampleUnpooledTTest();
                    TwoSampleTTest.SetInputData(NewTable);
                    TwoSampleTTest.Run();
                    VTable.SetInputData(TwoSampleTTest.GetOutPut());
                    VT.SetInputData(TwoSampleTTest.GetInfo());
                }
                else if (TestType == eTestType.STUDENT_T_TEST)
                {
                    StudentTTest = new cStudent_tTest();
                    StudentTTest.SetInputData(NewTable);
                    StudentTTest.Run();
                    VTable.SetInputData(StudentTTest.GetOutPut());
                    VT.SetInputData(StudentTTest.GetInfo());
                }
                VTable.DigitNumber = -1;
                VTable.Run();
                DS.SetInputData(VTable.GetOutPut());

                VT.Run();
                DS.SetInputData(VT.GetOutPut());
                DS.Run();
                DS.Title = cGlobalInfo.CurrentScreening.ListDescriptors[i].GetName();

                cDesignerSplitter DSMain = new cDesignerSplitter();
                DSMain.Orientation = Orientation.Horizontal;
                DSMain.SetInputData(DS.GetOutPut());

                // Compute and display associated Stacked histogram

                //CDW1.Title = CompleteScreening.ListDescriptors[CompleteScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName() + " - Stacked Histogram - " + PlateList.Count + " plates";

                cExtendedTable TableForHisto = ListWellsToProcess.GetAverageDescriptorValues(i);
                TableForHisto.Name = "";

                cViewerStackedHistogram CV1 = new cViewerStackedHistogram();
                CV1.SetInputData(TableForHisto);
                CV1.Chart.LabelAxisX = cGlobalInfo.CurrentScreening.ListDescriptors[i].GetName();
                CV1.Chart.IsLegend = true;
                CV1.Run();

                DSMain.SetInputData(CV1.GetOutPut());
                DSMain.Title = cGlobalInfo.CurrentScreening.ListDescriptors[i].GetName();
                DSMain.Run();
                DT.SetInputData(DSMain.GetOutPut());
            }

            DT.Run();
            cDisplayToWindow DTW = new cDisplayToWindow();
            DTW.SetInputData(DT.GetOutPut());
            DTW.Title = "Classification Significance - " + TestType.ToString();
            DTW.Run();
            DTW.Display();

        }
Exemplo n.º 3
0
        private void ToolStripMenuItem_TestsFTest(object sender, EventArgs e)
        {
            cExtendedTable CET = new cExtendedTable();
            foreach (DataGridViewColumn item in GridView.SelectedColumns)
                CET.Add(Input[item.Index]);

            cTwoSampleFTest S = new cTwoSampleFTest();
            S.SetInputData(CET);
            S.FTestTails = eFTestTails.BOTH;
            S.Run();

            cDisplayExtendedTable CDT = new cDisplayExtendedTable();
            CDT.DigitNumber = -1;
            CDT.SetInputData(S.GetOutPut());
            CDT.Run();
        }