mem_legend: MultiEnrichMap color legend

mem_legendR Documentation

MultiEnrichMap color legend

Description

MultiEnrichMap color legend

Usage

mem_legend(
  mem,
  x = "bottomleft",
  y = NULL,
  bg = "#FFFFFF99",
  box.col = "transparent",
  title = "Color Key",
  cex = 0.8,
  ncol = 1,
  pch = 21,
  pt.cex = 2,
  pt.lwd = 2,
  inset = 0,
  do_directional = FALSE,
  directional_column = c("same", "added-bottom", "added-top"),
  directional_colors = c(`up-regulated` = "firebrick3", `no change` = "grey80",
    `down-regulated` = "blue"),
  ...
)

Arguments

mem

list object output from multiEnrichMap(), specifically expected to contain element "colorV".

x, y, bg, box.col, title, cex, ncol, pch, pt.cex, pt.lwd, inset

arguments are passed to graphics::legend(). Note pt.lwd is mostly relevant with do_direction=TRUE, which adds open circles to the legend, whose line width has default pt.lwd=2.

do_directional

logical indicating whether to include directional colors defined in directional_colors, indicated only as the border color of nodes.

directional_column

character indicating how to add the directional colors to columns of legend, with two options:

  • "same": appends directional_colors to legend colors using the defined ncol number of columns.

  • "added-bottom": appends directional_colors as a new column so the resulting legend with have ncol+1 columns. In this case, intervening empty rows are filled with blank space, and the directional_colors are shown in the bottom-most rows in the far right column of the legend.

  • "added-top": appends directional_colors as a new column so the resulting legend with have ncol+1 columns. In this case, intervening empty rows are filled with blank space, and the directional_colors are shown in the top-most rows in the far right column of the legend.

directional_colors

character vector of R colors, named by the label to be shown in the legend, displayed in order (top to bottom, left to right) they appear in this vector. To remove the entry "no change", supply a new vector: directional_colors=c(up.regulated="firebrick3", down.regulated="blue")

...

additional arguments are passed to legend().

Details

This function is a simple wrapper around legend() to add a color key to a plot, typically for igraph plots.

See Also

Other jam plot functions: adjust_polygon_border(), grid_with_title(), jam_igraph(), mem_enrichment_heatmap(), mem_gene_path_heatmap(), mem_multienrichplot(), mem_plot_folio(), plot_layout_scale()


jmw86069/multienrichjam documentation built on Nov. 3, 2024, 10:29 p.m.