plot_enrichment: Generates plot for results from apl_topGO

Description Usage Arguments Value Examples

View source: R/plot.R

Description

Plots the results form the data frame generated via apl_topGO.

Usage

1
plot_enrichment(genenr, ntop = 10)

Arguments

genenr

data.frame. gene enrichment results table.

ntop

numeric. Number of elements to plot.

Value

Returns a ggplot plot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
library(Seurat)
set.seed(1234)
cnts <- GetAssayData(pbmc_small, slot = "counts")
cnts <- as.matrix(cnts)

# Run CA on example from Seurat

ca <- cacomp(pbmc_small,
             princ_coords = 3,
             return_input = FALSE,
             assay = "RNA",
             slot = "counts")

grp <- which(Idents(pbmc_small) == 2)
ca <- apl_coords(ca, group = grp)
ca <- apl_score(ca,
                mat = cnts)

enr <- apl_topGO(ca,
                 ontology = "BP",
                 organism = "hs")

plot_enrichment(enr)

elagralinska/APLpackage documentation built on Dec. 20, 2021, 4:15 a.m.