Plot2DrugHeatmap: Heatmap Plot for 2-drug Combination Dose-Response/Synergy...

View source: R/plot_two_drugs.R

Plot2DrugHeatmapR Documentation

Heatmap Plot for 2-drug Combination Dose-Response/Synergy Scores

Description

This function will generate a plot for 2-drug combinations. The axes are the dosage at which drugs are tested. The values could be observed response, synergy scores or the reference effects calculated from different models.

Usage

Plot2DrugHeatmap(
  data,
  plot_block = 1,
  drugs = c(1, 2),
  plot_value = "response",
  statistic = NULL,
  summary_statistic = NULL,
  dynamic = FALSE,
  plot_title = NULL,
  col_range = NULL,
  row_range = NULL,
  color_range = NULL,
  high_value_color = "#FF0000",
  low_value_color = "#00FF00",
  text_label_size_scale = 1,
  text_label_color = "#000000",
  title_text_size_scale = 1
)

Arguments

data

A list object generated by function ReshapeData.

plot_block

A character/integer. It indicates the block ID for the block to visualize.

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.

plot_value

A character value. It indicates the value to be visualized. If the data is the direct output from ReshapeData, the values for this parameter are:

  • response_origin The original response value in input data. It might be % inhibition or % viability.

  • response The % inhibition after preprocess by function ReshapeData

If the data is the output from CalculateSynergy, following values are also available:

  • ZIP_ref, Bliss_ref, HSA_ref, Loewe_ref The reference additive effects calculated by ZIP, Bliss, HSA or Loewe model, respectively.

  • ZIP_synergy, Bliss_synergy, HSA_synergy, Loewe_synergy The synergy score calculated by ZIP, Bliss, HSA or Loewe model, respectively.

  • ZIP_fit The response fitted by ZIP model.

statistic

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

  • sd Standard deviation;

  • sem Standard error of mean;

  • ci 95% confidence interval.

If it is NULL, no statistics will be printed.

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 and the p-value if it is valid;

  • 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.

dynamic

A logical value. If it is TRUE, this function will use plot_ly to generate an interactive plot. If it is FALSE, this function will use wireframe to generate a static plot.

plot_title

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

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.

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.

color_range

A vector of two numeric values. They specify the range of the color bars. The first item (lower bounder) must be less than the second one (upper bounder). The plotted values larger than defined upper bounder will be filled in color high_value_color. The plotted values less than defined lower bounder will be filled in color low_value_color. If the defined range includes 0, value 0 will be filled in color "white". By default, it is set as NULL which means the function will automatically set the color range according to the plotted values.

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_label_size_scale

A numeric value. It is used to control the size text labels on the heatmap. The text size will multiply by this scale factor.

text_label_color

NULL or an R color value. It indicates the color for text labels on the heatmap. If it is NULL, no text will be shown.

title_text_size_scale

A numeric value. It is used to control the size of legend title, legend text, plot title, axis title, axis tick, subtitle. All the text size will multiply by this scale factor.

Value

A ggplot plot object.

Author(s)

Examples

data("mathews_screening_data")
data <- ReshapeData(mathews_screening_data)
Plot2DrugHeatmap(data)

shuyuzheng/synergyfinder documentation built on Feb. 20, 2023, 11:33 p.m.