enrich_mods {CEMiTool} | R Documentation |
Returns enrichment of communities from edgelist created by cemoverlap function.
enrich_mods(community_list, analyses, comp_group = "none", subject_col = NULL, run_fgsea = FALSE)
community_list |
Community list obtained from overlap community function |
analyses |
List of CEMiTool objects |
comp_group |
Which group will be used as base for comparison. If 'none', then all combinations of comparisons will be made |
subject_col |
Column containing subject information in sample annotation slot of CEMiTool objects |
run_fgsea |
Logical. Should fgsea be run? |
This function assumes that relevant modules for a comparison in a study will have a high proportion of differentially regulated genes in a certain direction. Base assumption is that NON-relevant modules will be centered at zero.
A data.frame
containing information of how much each comparison is enriched in each community
in each CEMiTool object.
## Not run: # Run the cemitool function twice on expr dataset. Each time, one sample will be removed data(expr0) data(sample_annot) set.seed(10) dset1 <- expr0[,-sample(1:ncol(expr0), 1)] dset2 <- expr0[,-sample(1:ncol(expr0), 1)] cem1 <- cemitool(dset1, plot=FALSE) cem2 <- cemitool(dset2, plot=FALSE) cem_overlap_df <- cem_overlap(list(cem1, cem2)) comm_overlap <- overlap_community(cem_overlap_df) samples1 <- names(expr_data(cem1, filter=TRUE, apply_vst=TRUE)) samples2 <- names(expr_data(cem2, filter=TRUE, apply_vst=TRUE)) sample_annotation(cem1) <- sample_annot[sample_annot$SampleName %in% samples1, ] sample_annotation(cem2) <- sample_annot[sample_annot$SampleName %in% samples2, ] mod_enrich <- enrich_mods(comm_overlap, list(cem1, cem2), comp_group='g0') ## End(Not run)