plot_enrichment: Generates plot for results from apl_topGO

View source: R/plot.R

plot_enrichmentR Documentation

Generates plot for results from apl_topGO

Description

Plots the results from the data frame generated via apl_topGO.

Usage

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

library(Seurat)
set.seed(1234)
cnts <- GetAssayData(pbmc_small, assay = "RNA", 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)

ClemensKohl/APL documentation built on May 25, 2024, 3:15 p.m.