The resulting object can be passed to any method from the enrichplot package and thus allows for nice visualizations of the enrichment results. Note: term similarities are included if available.
as_enrichplot_object(x, pvalue_threshold = 0.05)
An object of class pareg
.
Treshold to select genes for count statistics.
Object of class enrichResult
.
df_genes <- data.frame(
gene = paste("g", 1:20, sep = ""),
pvalue = c(
rbeta(10, .1, 1),
rbeta(10, 1, 1)
)
)
df_terms <- rbind(
data.frame(
term = "foo",
gene = paste("g", 1:10, sep = "")
),
data.frame(
term = "bar",
gene = paste("g", 11:20, sep = "")
)
)
fit <- pareg(df_genes, df_terms, max_iterations = 10)
as_enrichplot_object(fit)
#> #
#> # over-representation test
#> #
#> #...@organism
#> #...@ontology UNKNOWN
#> #...@gene chr [1:8] "g4" "g5" "g6" "g7" "g8" "g9" "g10" "g18"
#> #...pvalues adjusted by '' with cutoff <
#> #...2 enriched terms found
#> 'data.frame': 2 obs. of 8 variables:
#> $ enrichment : num -0.753 -0.574
#> $ term_size : int 10 10
#> $ ID : chr "bar" "foo"
#> $ Description: chr "bar" "foo"
#> $ p.adjust : num -0.753 -0.574
#> $ Count : int 1 7
#> $ GeneRatio : chr "1/10" "7/10"
#> $ geneID : chr "g11/g12/g13/g14/g15/g16/g17/g18/g19/g20" "g1/g2/g3/g4/g5/g6/g7/g8/g9/g10"
#> - attr(*, "groups")= tibble [2 × 1] (S3: tbl_df/tbl/data.frame)
#> ..$ .rows: list<int> [1:2]
#> .. ..$ : int 1
#> .. ..$ : int 2
#> .. ..@ ptype: int(0)
#> #...Citation
#> T Wu, E Hu, S Xu, M Chen, P Guo, Z Dai, T Feng, L Zhou, W Tang, L Zhan, X Fu, S Liu, X Bo, and G Yu.
#> clusterProfiler 4.0: A universal enrichment tool for interpreting omics data.
#> The Innovation. 2021, 2(3):100141
#>