buildWaterfallPlot: Build a waterfall plot of drug response

Description Usage Arguments Value Examples

View source: R/waterfallPlot.R

Description

Use a waterfall plot to visualize drug sensitivity in decreasing order ( left -> right corresponds to most sensitive -> least sensitive). The waterfall plot can also be colored by a third parameter, such as statistical significance (p-value, fdr, etc.) There are many common uses of the waterfall plot, such as:

Usage

1
2
3
4
5
6
7
8
9
buildWaterfallPlot(
  drugResponseDf,
  xAxisCol,
  drugSensitivityCol,
  colorCol = NULL,
  xLabel = NULL,
  yLabel = NULL,
  title = NULL
)

Arguments

drugResponseDf

A data.frame of drug sensitivity measurements in different tumours, subtypes, or replicates

xAxisCol

The name of the column in biomarkerDf that will be mapped on the x-axis. Since this is a discrete axis, drugResponseDf$xAxisCol should be a vector of type "character".

drugSensitivityCol

The name of the column in biomarkerDf that has the drug sensitivity metrics; will be mapped on the y-axis. Since this is a continuous axis, drugResponseDf$drugSensitivityCol should be a vector of type "numeric".

colorCol

(optional) The name of the column that will determine the color of the bars (such as statistical significance). Since this is a continuous axis, drugResponseDf$colorCol should be a vector of type "numeric". If no column is provided, it will default to the drugSensitivityCol.

xLabel

(optional) The label for the x-axis. Defaults to <xAxisCol>.

yLabel

(optional) The label for the y-axis. Defaults to <drugSensitivityCol>.

title

(optional) The title for the plot. Defaults to '<drugSensitivityCol> vs. <xAxisCol>'

Value

A ggplot2 plot object mapping the drug sensitivity metrics against the xAxisCol, sorted in descending order by drug sensitivity and colored by colorCol

Examples

1
2
3
4
5
6
data(BRCA.PDXE.paxlitaxel.response)
buildWaterfallPlot(BRCA.PDXE.paxlitaxel.response,
                   xAxisCol="tumour", drugSensitivityCol="angle",
                   colorCol="ODC1", xLabel="Tumour",
                   yLabel="Angle Between Treatment and Control",
                   title="Paclitaxel Response in BRCA Tumours")

EvgeniyaGorobets/PGxVision documentation built on Dec. 17, 2021, 7:26 p.m.