Пример #1
0
        public void DisplayMINE(List<double>[] ListValueDesc)
        {
            int NumDesc = ListValueDesc.Length;

            double[,] CorrelationMatrix = new double[NumDesc, NumDesc];

            double[][] dataset1 = new double[NumDesc][];
            string[] VarNames = new string[NumDesc];

            for (int iDesc = 0; iDesc < NumDesc; iDesc++)
            {
                dataset1[iDesc] = new double[ListValueDesc[iDesc].Count];

                Array.Copy(ListValueDesc[iDesc].ToArray(), dataset1[iDesc], ListValueDesc[iDesc].Count);
                VarNames[iDesc] = iDesc.ToString();
            }
            data.Dataset data1 = new data.Dataset(dataset1, VarNames, 0);
            VarPairQueue Qu = new VarPairQueue(data1);

            for (int iDesc = 0; iDesc < NumDesc; iDesc++)
                for (int jDesc = 0; jDesc < iDesc; jDesc++)
                {
                    Qu.addPair(iDesc, jDesc);
                }
            Analysis ana = new Analysis(data1, Qu);
            AnalysisParameters param = new AnalysisParameters();
            double resparam = param.commonValsThreshold;

            //    analysis.results.FullResult Full = new analysis.results.FullResult();
            //List<analysis.results.BriefResult> Brief = new List<analysis.results.BriefResult>();
            //analysis.results.BriefResult Brief = new analysis.results.BriefResult();

            java.lang.Class t = java.lang.Class.forName("analysis.results.BriefResult");

            //java.lang.Class restype = null;
            ana.analyzePairs(t, param);

            //   object o =  (ana.varPairQueue().peek());
            //   ana.getClass();
            //  int resNum = ana.numResults();
            analysis.results.Result[] res = ana.getSortedResults();

            List<string[]> ListValues = new List<string[]>();
            List<string> NameX = CompleteScreening.ListDescriptors.GetListNameActives();

            List<bool> ListIscolor = new List<bool>();

            for (int Idx = 0; Idx < res.Length; Idx++)
            {
                ListValues.Add(res[Idx].toString().Split(','));
                ListValues[Idx][0] = NameX[int.Parse(ListValues[Idx][0])];
                ListValues[Idx][1] = NameX[int.Parse(ListValues[Idx][1])];
            }
            string[] ListNames = res[0].getHeader().Split(',');

            ListNames[0] = "Descriptor A";
            ListNames[1] = "Descriptor B";

            for (int NIdx = 0; NIdx < ListNames.Length; NIdx++)
            {
                if (NIdx == 0) ListIscolor.Add(false);
                else if (NIdx == 1) ListIscolor.Add(false);
                else ListIscolor.Add(true);

            }

            cDisplayTable DisplayForTable = new cDisplayTable("MINE Analysis results", ListNames, ListValues, GlobalInfo, true);
        }
Пример #2
0
        private void extractPhenotypesOfInterestToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (CompleteScreening == null) return;

            FormClassification WindowClassification = new FormClassification(CompleteScreening);
            WindowClassification.label1.Text = "Class";
            WindowClassification.Text = "Phenotypes of Interest";
            WindowClassification.buttonClassification.Text = "Display";

            if (WindowClassification.ShowDialog() != System.Windows.Forms.DialogResult.OK) return;
            int SelectedClass = WindowClassification.comboBoxForNeutralClass.SelectedIndex;

            List<string> ListDescName = new List<string>();
            ListDescName.Add("Idx");
            ListDescName.Add("Plate");
            ListDescName.Add("Pos X");
            ListDescName.Add("Pos Y");

            ListDescName.AddRange(CompleteScreening.ListDescriptors.GetListNameActives());

            List<string[]> ListValues = new List<string[]>();
            int Idx = 0;

            foreach (cPlate TmpPlate in CompleteScreening.ListPlatesActive)
            {
                foreach (cWell TmpWell in TmpPlate.ListActiveWells)
                {
                    if (TmpWell.GetClass() == SelectedClass)
                    {
                        List<string> LValues = new List<string>();
                        LValues.Add(Idx.ToString());
                        LValues.Add(TmpPlate.Name);
                        LValues.Add(TmpWell.GetPosX().ToString());
                        LValues.Add(TmpWell.GetPosY().ToString());

                        for (int IdxDesc = 0; IdxDesc < CompleteScreening.ListDescriptors.Count; IdxDesc++)
                        {
                            if (CompleteScreening.ListDescriptors[IdxDesc].IsActive())
                            {
                                double Value = TmpWell.GetAverageValuesList(false)[IdxDesc];
                                LValues.Add(Value.ToString());

                            }

                        }

                        ListValues.Add(LValues.ToArray());

                        Idx++;
                    }
                }

            }
            cDisplayTable WindowDisplayTable = new cDisplayTable("Phenotypes of Interest. Class " + SelectedClass, ListDescName.ToArray(), ListValues, GlobalInfo, false);
            WindowDisplayTable.Show();
        }