Skip to contents

This function generates a barplot labeled with the most frequent words in reduced GO term clusters. This can be useful for getting the gist of affected pathways or gene sets without relying on a singular GO term chosen by uniqueness, size, or significance.

Usage

plot_clustered_terms_top(
  reduced.terms,
  stoppers = c(tm::stopwords(kind = "en")),
  color = "#E69F00",
  n.top.terms = 5,
  n.top.clusters = NULL,
  perc.shift = 0.5,
  label.font.size = 5,
  xlabel = "score",
  ylabel = NULL
)

Arguments

reduced.terms

A `data.frame“ containing the reduced terms and their associated scores.

stoppers

A character vector of stopwords to exclude from the terms. Defaults to general English stopwords ("of", "the", "a" and the like). See stopwords(kind = "en") for specifics.

color

Fill color of the bars. Default is "#E69F00".

n.top.terms

An integer specifying the number most frequent terms to display per cluster. Default is 5.

n.top.clusters

An optional integer specifying the number of top clusters to display. If NULL, all clusters are displayed.

perc.shift

A numeric value specifying the percentage by which the color should be darkened/lightened from the low to high cluster. Default is 0.5.

label.font.size

A numeric value specifying the font size for the labels. Default is 5.

xlabel

A string specifying the label for the x-axis. Default is "score".

ylabel

A string specifying the label for the y-axis.

Value

A ggplot object.

Author

Jared Andrews

Examples

plot_clustered_terms_top(reduced_terms, n_top_terms = 5, color = "blue")
#> Error in plot_clustered_terms_top(reduced_terms, n_top_terms = 5, color = "blue"): unused argument (n_top_terms = 5)