示例#1
0
        private void hierarchicalTreeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormForHierarchical WindowHierarchical = new FormForHierarchical(this.GlobalInfo);
            WindowHierarchical.richTextBoxWarning.AppendText("Warning:\nHierarchical tree visualization is not adpated for large number of experiments !\nIt can rapidly generate out-of-memory exception!");

            System.Windows.Forms.DialogResult Res = WindowHierarchical.ShowDialog();// MessageBox.Show("Hierarchical tree is not adpated for large number of experiments !\n It can rapidly generate out-of-memory exception!\n Proceed anyway ?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
            if (Res != System.Windows.Forms.DialogResult.OK) return;
            cDendoGram DendoGram = new cDendoGram(GlobalInfo, WindowHierarchical.radioButtonFullScreen.Checked, 1);
            //cDendoGram DendoGram = new cDendoGram(GlobalInfo,
            //    CompleteScreening.ListPlatesActive[CompleteScreening.CurrentDisplayPlateIdx].CreateInstancesWithoutClass(),
            //    1);
            return;
        }
示例#2
0
        private void correlationMatrixToolStripMenuItem1_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;
            }


            if (checkedListBoxActiveDescriptors.CheckedItems.Count <= 1)
            {
                MessageBox.Show("At least two descriptors have to be selected", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            cGUI_ListClasses GUI_ListClasses = new cGUI_ListClasses();
            GUI_ListClasses.IsCheckBoxes = true;
            GUI_ListClasses.IsSelectAll = true;

            if (GUI_ListClasses.Run().IsSucceed == false) return;
            cExtendedList ListClassSelected = GUI_ListClasses.GetOutPut()[0];

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


            cDesignerTab DT = new cDesignerTab();

            if (this.ProcessModeplateByPlateToolStripMenuItem.Checked)
            {
                foreach (cPlate TmpPlate in cGlobalInfo.CurrentScreening.ListPlatesActive)
                {
                    //ListWellsToProcess.AddRange(TmpPlate.ListActiveWells);
                    cListWells ListWellsToProcess = new cListWells(null);

                    foreach (cWell item in TmpPlate.ListActiveWells)
                    {
                        if ((item.GetCurrentClassIdx() != -1) && (ListClassSelected[item.GetCurrentClassIdx()] == 1)) ListWellsToProcess.Add(item);
                    }

                    cExtendedTable NewTable = new cExtendedTable(ListWellsToProcess, true);

                    cCorrelationMatrix CM = new cCorrelationMatrix();
                    CM.SetInputData(NewTable);
                    CM.Run();


                    cExtendedTable CorrelationMatrix = CM.GetOutPut();
                    weka.core.Instances Insts = CorrelationMatrix.CreateWekaInstances();


                    weka.clusterers.HierarchicalClusterer ClustererToReturn = new weka.clusterers.HierarchicalClusterer();
                    // string OptionDistance = " -N " + (int)Parameters.ListDoubleValues.Get("numericUpDownNumClasses").Value;

                    //string DistanceType = (string)Parameters.ListTextValues.Get("comboBoxDistance").Value;
                    //OptionDistance += " -A \"weka.core.";
                    //switch (DistanceType)
                    //{
                    //    case "Euclidean":
                    //        OptionDistance += "EuclideanDistance";
                    //        break;
                    //    case "Manhattan":
                    //        OptionDistance += "ManhattanDistance";
                    //        break;
                    //    case "Chebyshev":
                    //        OptionDistance += "ChebyshevDistance";
                    //        break;
                    //    default:
                    //        break;
                    //}

                    //if (!(bool)Parameters.ListCheckValues.Get("checkBoxNormalize").Value)
                    //    OptionDistance += " -D";
                    //OptionDistance += " -R ";


                    //OptionDistance += "first-last\"";
                    //string WekaOption = "-L " + (string)Parameters.ListTextValues.Get("comboBoxLinkType").Value + OptionDistance;
                    ((weka.clusterers.HierarchicalClusterer)ClustererToReturn).setOptions(weka.core.Utils.splitOptions("-N 1 -L SINGLE -P -A \"weka.core.EuclideanDistance -R first-last\" "));

                    ClustererToReturn.buildClusterer(Insts);
                    //this.NumberOfClusters = ClustererToReturn.numberOfClusters();
                    cInfoForHierarchical IFH = new cInfoForHierarchical();
                    IFH.ListInstances = Insts;

                    cDendoGram DENDO = new cDendoGram(((weka.clusterers.HierarchicalClusterer)ClustererToReturn), IFH, GlobalInfo);



                    //cViewerHeatMap VHM = new cViewerHeatMap();
                    cViewerTable VHM = new cViewerTable();
                    VHM.SetInputData(CM.GetOutPut());
                    //VHM.IsDisplayValues = true;
                    VHM.Title = "Correlation - " + TmpPlate.GetName() + " (" + ListWellsToProcess.Count + " wells)";
                    VHM.Run();
                    VHM.GetOutPut().Title = TmpPlate.GetName();
                    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) && (ListClassSelected[item.GetCurrentClassIdx()] == 1)) ListWellsToProcess.Add(item);
                }

                cExtendedTable NewTable = new cExtendedTable(ListWellsToProcess, true);

                cCorrelationMatrix CM = new cCorrelationMatrix();
                CM.SetInputData(NewTable);
                CM.Run();

                //cViewerHeatMap VHM = new cViewerHeatMap();
                cViewerTable VHM = new cViewerTable();
                VHM.SetInputData(CM.GetOutPut());
                //VHM.IsDisplayValues = true;
                VHM.Title = "Correlation - 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) && (ListClassSelected[item.GetCurrentClassIdx()] == 1)) ListWellsToProcess.Add(item);

                cExtendedTable NewTable = new cExtendedTable(ListWellsToProcess, true);

                cCorrelationMatrix CM = new cCorrelationMatrix();
                CM.SetInputData(NewTable);
                CM.Run();

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

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

            DT.Run();

            //  DT.SetInputData(VT.GetOutPut());

            //cDesignerColumn DC = new cDesignerColumn();  
            //DC.SetInputData(VHM.GetOutPut());
            //DC.SetInputData(VT.GetOutPut());
            //DC.Run();

            //cDisplayDesigner DD = new cDisplayDesigner();
            // DD.SetInputData(VHM.GetOutPut());
            // DD.Run();

            cDisplayToWindow vD = new cDisplayToWindow();
            vD.SetInputData(DT.GetOutPut());
            vD.Title = "Pearson Correlation";
            vD.Run();
            vD.Display();

            //ComputeAndDisplayCorrelationMatrix(false, true, null);
        }
示例#3
0
 private void hierarchicalClusteringToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     System.Windows.Forms.DialogResult Res = MessageBox.Show("Hierarchical tree is not adpated for large number of experiments !\n It can rapidly generate out-of-memory exception!\n Proceed anyway ?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
     if (Res == System.Windows.Forms.DialogResult.No) return;
     cDendoGram DendoGram = new cDendoGram(GlobalInfo, true);
     return;
 }
示例#4
0
 private void hierarchicalTreeToolStripMenuItem_Click(object sender, EventArgs e)
 {
     cDendoGram DendoGram = new cDendoGram(GlobalInfo, false);
 }
示例#5
0
        private void ClickToDisplayHierarchicalTree(object sender, EventArgs e)
        {
            cDendoGram Dendogram = new cDendoGram(((HierarchicalClusterer)SelectedClusterer),null, null);

            FormDendogram WindowForDendoGram = new FormDendogram(GlobalInfo);
            WindowForDendoGram.CurrentDendo = Dendogram;
            WindowForDendoGram.Show();
        }