plot_score: Plot a Summary Line Plot or Heatmap from an Integrated Data...

Description Usage Arguments Value Examples

Description

plot_score() takes a summary data frame (presumably generated by integrate_score()), and plot a line plot or heatmap to visualize the change of scores in different experiments.

Usage

1
2
3
plot_score(x, facet = NULL, exp.order = NULL, cols.use = NULL,
  predictors.use = NULL, targets.use = NULL, plot.type = "line",
  title = NULL, k.groups = NULL)

Arguments

x

a data frame, presumably generated by integrate_score()

facet

a character string. Options are "predictor" and "target". If set, the line plot will be separated into multiple panel according to the value of predictor or target

exp.order

a character vector containing the column names provided to plot_score(), indicating the order of them

cols.use

a character vector containing 3 colors to indicate the color used in a heatmap to represent low, mid, and high value respectively

predictors.use

a character vector indicating the predictors to plot

targets.use

a character vector indicating the predictors to plot

plot.type

a character string indicating whether a lineplot ("line"), a heatmap ("heatmap"), or a hierarchy tree ("tree")should be generated

title

a character string indicating the title of the plot

k.groups

a numeric value indicating the number of clusters to form in hierarchical clustering for the predictor-target pairs

Value

a ggplot2 object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# Generating a dummy data frame containing predictor, target, and columns of
# scores
intedf <- data.frame(
  "predictor" = c("tf_1", "tf_2", "tf_3", "tf_4"),
  "target" = c("gene_1", "gene_2", "gene_1", "gene_2"),
  "t1" = c(0, 5, 1, 5),
  "t2" = c(0, 3, 0, 1),
  "t3" = c(0, 6, 2, 6),
  "t4" = c(2, 7, 8, 9),
  "t5" = c(9, 2, 2, 7),
  stringsAsFactors = FALSE
)

# Plot a line plot
plot_score(x = intedf, plot.type = "line")

# Plot a heatmap
plot_score(x = intedf, plot.type = "heatmap")

chenyenchung/genofeatutil documentation built on May 15, 2019, 10:38 p.m.