Exemple #1
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();

        }
Exemple #2
0
        private void ToolStripMenuItem_Tests2SamplesTTest(object sender, EventArgs e)
        {
            cExtendedTable CET = new cExtendedTable();
            foreach (DataGridViewColumn item in GridView.SelectedColumns)
                CET.Add(Input[item.Index]);

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

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