Skip to contents

Simplify Gene Ontology (GO) enrichment results

Usage

simplifyGO(
  mat,
  method = "binary_cut",
  control = list(),
  plot = TRUE,
  verbose = TRUE,
  column_title = qq("@{nrow(mat)} GO terms clustered by '@{method}'"),
  ht_list = NULL,
  ...
)

simplifyEnrichment(...)

Arguments

mat

A GO similarity matrix. You can also provide a vector of GO IDs to this argument.

method

Method for clustering the matrix. See cluster_terms().

control

A list of parameters for controlling the clustering method, passed to cluster_terms().

plot

Whether to make the heatmap.

verbose

Whether to print messages.

column_title

Column title for the heatmap.

ht_list

A list of additional heatmaps added to the left of the similarity heatmap.

...

Arguments passed to ht_clusters().

Value

A data frame with two columns: GO IDs and cluster labels.

Details

This is basically a wrapper function that it first runs cluster_terms() to cluster GO terms and then runs ht_clusters() to visualize the clustering.

The arguments in simplifyGO() passed to ht_clusters() are:

  • draw_word_cloud: Whether to draw the word clouds.

  • min_term: Minimal number of GO terms in a cluster. All the clusters with size less than min_term are all merged into one single cluster in the heatmap.

  • order_by_size: Whether to reorder GO clusters by their sizes. The cluster that is merged from small clusters (size < min_term) is always put to the bottom of the heatmap.

  • stat: What values of keywords are used to map to font sizes in the word clouds.

  • exclude_words: Words that are excluded in the word cloud.

  • max_words: Maximal number of words visualized in the word cloud.

  • word_cloud_grob_param: A list of graphic parameters passed to word_cloud_grob().

  • fontsize_range The range of the font size. The value should be a numeric vector with length two. The minimal font size is mapped to word frequency value of 1 and the maximal font size is mapped to the maximal word frequency. The font size interlopation is linear.

  • bg_gp: Graphic parameters for controlling the background of word cloud annotations.

Examples

# \donttest{
set.seed(123)
go_id = random_GO(500)
mat = GO_similarity(go_id)
#> You haven't provided value for `ont`, guess it as `BP`.
#> term_sim_method: Sim_XGraSM_2013
#> IC_method: IC_annotation
df = simplifyGO(mat, word_cloud_grob_param = list(max_width = 80))
#> Cluster 500 terms by 'binary_cut'...
#>  15 clusters, used 4.969077 secs.
#> Perform keywords enrichment for 8 GO lists...

head(df)
#>           id cluster
#> 1 GO:0009237       1
#> 2 GO:0009416       2
#> 3 GO:0070723       2
#> 4 GO:0051316       3
#> 5 GO:0140495       4
#> 6 GO:0010902       3
# }