enrichment_barplot: Create a barplot using ggplot2 to show enrichment results

Description Usage Arguments Value See Also Examples

View source: R/plot_enrichment.R

Description

This function takes a topGOdata object and a topGOresult object to display the enrichment statistics of top N GO terms. It wraps ggplot2 plotting, and returns a ggplot2 graphic object.

Usage

1
2
3
enrichment_barplot(object, result, showTerms = 10, numChar = 40, 
		   orderBy = "Scores", y = "Count", 
		   xlab = NULL, ylab = NULL, title = NULL)

Arguments

object

(Required). A topGOdata object.

result

(Required). A topGOresult object.

showTerms

(Optional). A single integer or a character vector of GO ID. Default is 10. Indicates the number of GO terms to show.

numChar

(Optional). A single integer. Default is 40. Indicates the number characters to keep in the GO term description

orderBy

(Optional). A character string. Default is "Scores". Indicates how to order the test results before subsetting to taking top N terms. It can be either "Scores" (i.e. p-values) or "Ratio"

y

(Optional). A character string. Default is "Count". Indicates the variable that should be mapped to the y-axis. It can be either "Count" or "Ratio"

xlab

(Optional). A character string. Default is NULL. Indicates the x-axis label.

ylab

(Optional). A character string. Default is NULL. Indicates the y-axis label.

title

(Optional). A character string. Default is NULL Indicates the main title for the graphic.

Value

A ggplot2 plot object

See Also

ggplot

Examples

1
2
3
4
5
6
data(GOdata)
data(results.tGO)

resultFisher <- runTest(GOdata, algorithm = "classic", statistic = "fisher")
enrichment_barplot(GOdata, resultFisher, showTerms = 10, numChar = 40,
                   orderBy = "Scores", y = "Count")

ycl6/topGO-feat documentation built on Aug. 12, 2020, 12:55 a.m.