PlotSynergy: Plot Interaction Landscape for Synergy Scores

Description Usage Arguments Value Author(s) Examples

View source: R/plot_wrapper.R

Description

A function to visualize the synergy scores for drug combinations as 2D or 3D interaction landscape over the dose-response matrix.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
PlotSynergy(
  data,
  type = "2D",
  method = "ZIP",
  block_ids = c(1),
  drugs = c(1, 2),
  row_range = NULL,
  col_range = NULL,
  statistic = NULL,
  summary_statistic = "mean",
  plot_title = NULL,
  interpolate_len = 3,
  high_value_color = "#A90217",
  low_value_color = "#2166AC",
  text_size_scale = 1,
  heatmap_text_label_size_scale = 1,
  heatmap_text_label_color = "#000000",
  surface_grid = TRUE,
  dynamic = FALSE,
  display = TRUE,
  save_file = FALSE,
  file_name = NULL,
  file_path = NULL,
  height = 6,
  width = 6,
  units = "in",
  device = "pdf"
)

Arguments

data

A list object generated by function CalculateSynergy

type

A character value. It specifies the type of the plot. Available values are:

  • 2D Visualize 2D interactive landscape with contour plot.

  • heatmap Heatmap for synergy scores.

  • 3D Visualize 3D surface for interactive landscape.

method

A character value. It indicates which synergy score to be visualized. Available values are "ZIP", "HSA", "Bliss", or "Loewe".

block_ids

A parameter to specify which drug combination if there are many drug combinations in the data. By default, it is NULL so that the synergy score visualization of all the drug combinations in the data is returned.

drugs

A vector of characters or integers with length of 2. It contains the index for two drugs to plot. For example, c(1, 2) indicates to plot "drug1" and "drug2" in the input data.

row_range

A vector of two integers. They specify the starting and ending concentration of the drug on y-axis. Use e.g., c(1, 3) to specify that only from 1st to 3rd concentrations of the drug on y-axis are used. By default, it is NULl so all the concentrations are used.

col_range

A vector of two integers. They specify the starting and ending concentration of the drug on x-axis. Use e.g., c(1, 3) to specify that only from 1st to 3rd concentrations of the drug on x-axis are used. By default, it is NULl so all the concentrations are used.

statistic

A character or NULL. It indicates the statistics printed in the plot while there are replicates in input data. Available values are:

  • sem Standard error of mean;

  • ci 95% confidence interval.

If it is NULL, no statistics will be printed. Note: It only works in Heatmap plot.

summary_statistic

A vector of characters or NULL. It indicates the summary statistics for all the plot_value in whole combination matrix. Available values are:

  • mean Median value for all the responses or synergy scores in the matrix;

  • median Median value for all the responses or synergy scores in the matrix;

  • quantile_90 90% quantile. User could change the number to print different sample quantile. For example quantile_50 equal to median.

If it is NULL, no statistics will be printed.

plot_title

A character value. It specifies the plot title. If it is NULL, the function will automatically generate a title.

interpolate_len

An integer. It specifies how many values need to be interpolated between two concentrations. It is used to control the smoothness of the synergy surface in the contour plot and surface plot. Note: It only works in 2D and 3D plots.

high_value_color

An R color value. It indicates the color for the high values.

low_value_color

An R color value. It indicates the color for low values.

text_size_scale

A numeric value. It is used to control the size of text in the plot. All the text size will multiply by this scale factor.

heatmap_text_label_size_scale

A numeric value. It is used to control the size of text labels in the heatmap plot. It only works while plot_type = "heatmap".

heatmap_text_label_color

NULL or an R color value. It is used to control the color of text labels in the heatmap plot. If it is NULL, text label will not be shown. It only works while plot_type = "heatmap".

surface_grid

A logical value. It indicates whether to add grids on the surface. It only works while plot_type = "3D".

dynamic

A logic value. It indicates whether to generate interactive plot wit package "plotly" or static plot with package "ggplot2"/"lattice".

display

A logic value. It specifies whether to automatically display plots while calling the function.

save_file

A logic value. It specifies if the interaction landscapes is saved by calling ggsave function ("2D" or "heatmap" plots) or plot saving function defined by device ("3D" plots). By default, it is FALSE. Note: It doesn't work while dynamic = TRUE, because installation of "Orca" is required for exporting plotly plots. Please check https://plotly.com/r/static-image-export/ for more details.

file_name

A character vector. It indicates the file names. If it is not defined by user, a default name will be assigned. Note: It only works while save_file = TRUE.

file_path

A character vector. It indicates the path to save file. If it is not defined by user, a default name will be assigned. Note: It only works while save_file = TRUE.

height

A numeric value. It indicates the height of the output plot. Note: It only works while save_file = TRUE.

width

A numeric value. It indicates the width of the output plot. Note: It only works while save_file = TRUE.

units

A character value. It indicates the units for width and height for saved plots. It is used to set the units parameter in function ggsave or the function selected by device (It will not work on "pdf" and "svg" devices. There units are always in inch.). Note: It only works while save_file = TRUE.

device

A character value. It indicates the device to use for saving plots. If type = "3D", the corresponding device function in package "grDevices" will be called to save the plots. If type = "2D"/"heatmap", it will be used to set the parameter device in function ggsave. Note: It only works while save_file = TRUE.

Value

A list of ggplot objects.

Author(s)

Examples

1
2
3
4
data("mathews_screening_data")
data <- ReshapeData(mathews_screening_data)
data <- CalculateSynergy(data)
plots <- PlotSynergy(data, "2D", block_ids = NULL)

synergyfinder documentation built on April 4, 2021, 6 p.m.