コード例 #1
0
ファイル: cWell.cs プロジェクト: cyrenaique/HCS
        void listBox1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            string[] fg_list = { "black" };
            string[] bg_list = { "orange" };
            string[] intersection_gene_pathways = new string[1];

            intersection_gene_pathways[0] = "hsa:" + LocusID;

            string pathway_map_html = "";
            KEGG ServKegg = new KEGG();
            foreach (string item in ListP.listBoxPathways.SelectedItems)
            {
                pathway_map_html = ServKegg.get_html_of_colored_pathway_by_objects(item, intersection_gene_pathways, fg_list, bg_list);
            }

            string GenInfo = ServKegg.bget((string)ListP.listBoxPathways.SelectedItem);
            string[] Genes = GenInfo.Split(new char[] { '\n' });
            string Res = "";
            foreach (string item in Genes)
            {
                string[] fre = item.Split(' ');
                string[] STRsection = fre[0].Split('_');

                if (STRsection[0] != "NAME") continue;

                for (int i = 1; i < fre.Length; i++)
                {
                    if (fre[i] == "") continue;
                    Res += fre[i] + " ";
                }
            }

            FormForKegg KeggWin = new FormForKegg();

            if (pathway_map_html.Length == 0) return;

            KeggWin.Text = Res;
            KeggWin.Show();

            KeggWin.webBrowser.Navigate(pathway_map_html);
        }
コード例 #2
0
ファイル: cWell.cs プロジェクト: HCSAnalyzer/HCS-Analyzer
        void listBox1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            string[] fg_list = { "black" };
            string[] bg_list = { "orange" };
            string[] intersection_gene_pathways = new string[1];

            intersection_gene_pathways[0] = "hsa:" + LocusID;

            string pathway_map_html = "";
            KEGG ServKegg = new KEGG();

            string[] ListGenesinPathway = ServKegg.get_genes_by_pathway((string)ListP.listBoxPathways.SelectedItem);
            double[] ListValues = new double[ListGenesinPathway.Length];
            int IDxGeneOfInterest = 0;
            foreach (cPlate CurrentPlate in Parent.ListPlatesActive)
            {
                foreach (cWell CurrentWell in CurrentPlate.ListActiveWells)
                {
                    string CurrentLID = "hsa:" + (int)CurrentWell.LocusID;

                    for (int IdxGene = 0; IdxGene < ListGenesinPathway.Length; IdxGene++)
                    {

                        if (CurrentLID == intersection_gene_pathways[0])
                            IDxGeneOfInterest = IdxGene;

                        if (CurrentLID == ListGenesinPathway[IdxGene])
                        {
                            ListValues[IdxGene] = CurrentWell.ListDescriptors[Parent.ListDescriptors.CurrentSelectedDescriptor].GetValue();
                            break;
                        }
                    }
                }
            }

            bg_list = new string[ListGenesinPathway.Length];
            fg_list = new string[ListGenesinPathway.Length];

            double MinValue = ListValues.Min();
            double MaxValue = ListValues.Max();

            for (int IdxCol = 0; IdxCol < bg_list.Length; IdxCol++)
            {

                int ConvertedValue = (int)((((Parent.GlobalInfo.LUTs.LUT_JET[0].Length - 1) * (ListValues[IdxCol] - MinValue)) / (MaxValue - MinValue)));

                Color Coul = Color.FromArgb(Parent.GlobalInfo.LUTs.LUT_JET[0][ConvertedValue], Parent.GlobalInfo.LUTs.LUT_JET[1][ConvertedValue], Parent.GlobalInfo.LUTs.LUT_JET[2][ConvertedValue]);

                if (IdxCol == IDxGeneOfInterest)
                    fg_list[IdxCol] = "white";
                else
                    fg_list[IdxCol] = "#000000";
                bg_list[IdxCol] = "#" + Coul.Name.Remove(0, 2);

            }

            pathway_map_html = ServKegg.get_html_of_colored_pathway_by_objects((string)ListP.listBoxPathways.SelectedItem, ListGenesinPathway, fg_list, bg_list);

            string GenInfo = ServKegg.bget((string)ListP.listBoxPathways.SelectedItem);
            string[] Genes = GenInfo.Split(new char[] { '\n' });
            string Res = "";
            foreach (string item in Genes)
            {
                string[] fre = item.Split(' ');
                string[] STRsection = fre[0].Split('_');

                if (STRsection[0] != "NAME") continue;

                for (int i = 1; i < fre.Length; i++)
                {
                    if (fre[i] == "") continue;
                    Res += fre[i] + " ";
                }
            }

            FormForKegg KeggWin = new FormForKegg();

            if (pathway_map_html.Length == 0) return;

            KeggWin.Text = Res;
            KeggWin.Show();

            KeggWin.webBrowser.Navigate(pathway_map_html);
        }