GOTreeVis: Tree visualization for Gene Ontology enrichment results

View source: R/GOTreeVis.R

GOTreeVisR Documentation

Tree visualization for Gene Ontology enrichment results

Description

GOTreeVis creates a GOTree visualisation of GO enrichment data and writes it to a pdf file.

Usage

GOTreeVis(disp_data, out_file, b_rootlabel = "",
  b_sidelabels = c("GO:MF", "GO:BP"), b_parse = F,
  plot_pvalue_labels = T, root_color = "black",
  colors = c("deepskyblue3", "seagreen3"), oneside = NULL,
  font = "sans", pval_scaling = NA, br_spacing = NA, tr_width = 4,
  br_min_size = 2, br_max_size = 4, br_angle = 1/7,
  br_textoffset_x = 0, br_textoffset_y = 0, br_offset = NA,
  plot_size = 8, label_size = 4, expand_x = c(0.1, 0.1))

Arguments

disp_data

Enrichment data to visualize. Four columns:

  1. Term

  2. Pvalue - scales the length of the branches

  3. Count (i.e. number of genes matching the term) - scales the thickness of the branches. If this scaling is not needed, this column should be set to all equal values. All branches will then be set to min_size.

  4. a column used to determine the side of the tree, e.g. ontology (BP/MF).

In case of a one-sided tree (see oneside parameter) the fourth column can be omitted. The side column should be a factor with two levels (first level = left, second = right). For character side columns a factor will be generated (levels will be in alphabetical order).

out_file

Filename of the output file. The name must end with a valid file extension to define the graphics device. PDF output is recommended.

b_rootlabel

Text for the label at the root of the tree. [default: ""]

b_sidelabels

Text for the labels on each side; The first value corresponds to the left side. [default: ('GO:MF','GO:BP')]

b_parse

Parse text for root and side labels using plotmath. Can be used to plot labels containing superscript or subscript.

plot_pvalue_labels

Should the p-value labels on the axis be plotted or not? [default: T]

root_color

Color for the 'root' box at the bottom of the tree. Applies to text and border. [default: black]

colors

Colors for the two sides of the tree, again first=left. [default: blue/green]

oneside

Special functionality in case only one category should be plotted.

font

Font family to be used for the text in the plot [default: sans]

pval_scaling

Scaling factor between -log(pvalue) and branch length; Gets generated automatically from the dimensions of the data if left unset (recommended for first run). Can be used to scale the tree in x dimension. [default: NA]

br_spacing

Spacing between branches. Gets generated automatically from the dimensions of the data if left unset (recommended for first run). Can be used to scale the tree in y dimension. [default: NA]

tr_width

Adjusts the width of the trunk. [default: 4]

br_min_size

Sets the count->branch_width scale. Defines the size(width) of the branch with the smallest count value. [default: 2]

br_max_size

Sets the count->branch_width scale. Defines the size(width) of the branch with the highest count value. [default: 4]

br_angle

Angle of the branches in radians as multiples of pi. [default: 1/7, equal to 180°/7]

br_textoffset_x

Manually offset the text from the branches (x-axis). [default: 0]

br_textoffset_y

Manually offset the text from the branches (y-axis). [default: 0]

br_offset

Adjust the position of the top branch (e.g. if the position should be at the very top). [default: scales with spacing]

plot_size

Plot size, passed to ggsave for both height and width; changes of this value will likely require adjustments of label_size. [default: 8]

label_size

Adjusts the font size of all labels in the plot. [default: 4]

expand_x

[default: (0.1,0.1)] can be used to expand the plot area on each side in case of long labels

Value

PDF file (out_file)


dottercp/GOTreeVis documentation built on April 18, 2023, 9:41 p.m.