コード例 #1
0
        public Leave_out_scp_scp_network_options_class Deep_copy()
        {
            Leave_out_scp_scp_network_options_class copy = (Leave_out_scp_scp_network_options_class)this.MemberwiseClone();

            copy.Top_quantile_of_considered_SCP_interactions_per_level = Array_class.Deep_copy_array(this.Top_quantile_of_considered_SCP_interactions_per_level);
            return(copy);
        }
コード例 #2
0
        public Ontology_fisher_class Deep_copy()
        {
            Ontology_fisher_class copy = (Ontology_fisher_class)this.MemberwiseClone();

            copy.MBCO_association = this.MBCO_association.Deep_copy();
            copy.Bg_genes         = Array_class.Deep_copy_string_array(this.Bg_genes);
            return(copy);
        }
コード例 #3
0
        public Mbc_add_inferred_parentSCP_line_class Deep_copy()
        {
            Mbc_add_inferred_parentSCP_line_class copy = (Mbc_add_inferred_parentSCP_line_class)this.MemberwiseClone();

            copy.Inferred_parentSCP = (string)this.Inferred_parentSCP.Clone();
            copy.Children_scps      = Array_class.Deep_copy_string_array(this.Children_scps);
            return(copy);
        }
コード例 #4
0
 public void Generate(MBCO_association_class mbco_association, Ontology_type_enum ontology, params string[] bg_symbols)
 {
     this.Ontology         = ontology;
     this.Bg_genes         = Array_class.Deep_copy_string_array(bg_symbols);
     this.MBCO_association = mbco_association.Deep_copy();
     if (this.Bg_genes.Length > 0)
     {
         MBCO_association.Keep_only_bg_symbols(bg_symbols);
     }
 }
コード例 #5
0
        public void Add_ancestors_of_missing_levels(MBCO_obo_network_class mbco_obo_network_parent_child)
        {
            MBCO_obo_network_class mbco_obo_network_child_parent = mbco_obo_network_parent_child.Deep_copy_mbco_obo_nw();

            mbco_obo_network_child_parent.Transform_into_child_parent_direction();

            MBCO_obo_network_class current_mbco_obo_network;

            int[] levels_in_scp        = this.Scp_nw.Nodes.Get_all_levels();
            int   levels_in_scp_length = levels_in_scp.Length;
            int   level_in_scp;
            int   max_level_in_scp = -1;

            for (int indexLevelScp = 0; indexLevelScp < levels_in_scp_length; indexLevelScp++)
            {
                level_in_scp = levels_in_scp[indexLevelScp];
                if ((max_level_in_scp == -1) ||
                    (max_level_in_scp < level_in_scp))
                {
                    max_level_in_scp = level_in_scp;
                }
            }
            int[]      levels_in_mbco         = mbco_obo_network_child_parent.Nodes.Get_all_levels();
            int[]      add_levels_preliminary = Overlap_class.Get_part_of_list1_but_not_of_list2(levels_in_mbco, levels_in_scp);
            List <int> add_levels_list        = new List <int>();

            foreach (int add_level_preliminary in add_levels_preliminary)
            {
                if ((add_level_preliminary < max_level_in_scp) && (add_level_preliminary != 0))
                {
                    add_levels_list.Add(add_level_preliminary);
                }
            }
            int[] add_levels = add_levels_list.ToArray();

            add_levels = add_levels.OrderByDescending(l => l).ToArray();
            int add_length = add_levels.Length;
            int add_level;

            string[] add_parents;
            string[] children;
            string[] keep_nodes;
            for (int indexAdd = 0; indexAdd < add_length; indexAdd++)
            {
                add_level                = add_levels[indexAdd];
                level_in_scp             = add_level + 1;
                children                 = this.Scp_nw.Nodes.Get_all_nodeNames_of_indicated_levels(level_in_scp);
                add_parents              = mbco_obo_network_child_parent.Get_all_parents_if_direction_is_child_parent(children);
                current_mbco_obo_network = mbco_obo_network_parent_child.Deep_copy_mbco_obo_nw();
                keep_nodes               = Array_class.Get_ordered_union(add_parents, children);
                current_mbco_obo_network.Keep_only_input_nodeNames(keep_nodes);
                this.Scp_nw.Merge_this_network_with_other_network(current_mbco_obo_network);
            }
        }
コード例 #6
0
 private void Generate_mbco_association(string[] bg_genes)
 {
     if (Options.Report)
     {
         Report_class.WriteLine("{0}: Generate MBCO gene-SCP association networks", typeof(Mbc_enrichment_pipeline_class).Name);
     }
     MBCO_association = new MBCO_association_class();
     MBCO_association.Generate_by_reading_safed_file();
     string[] all_mbco_genes = MBCO_association.Get_all_distinct_ordered_symbols();
     if (bg_genes.Length > 0)
     {
         this.Exp_bg_genes   = Array_class.Deep_copy_string_array(bg_genes);
         this.Final_bg_genes = Overlap_class.Get_intersection(this.Exp_bg_genes, all_mbco_genes);
     }
     else
     {
         this.Exp_bg_genes   = new string[0];
         this.Final_bg_genes = Array_class.Deep_copy_string_array(all_mbco_genes);
     }
     this.MBCO_association.Keep_only_bg_symbols(this.Final_bg_genes);
     this.MBCO_association.Remove_background_genes_scp();
     this.MBCO_fisher_standard = new Ontology_fisher_class();
     this.MBCO_fisher_standard.Generate(this.MBCO_association, Ontology_type_enum.Molecular_biology_cell, this.Final_bg_genes);
 }