View source: R/waterfall_plot.R
waterfall | R Documentation |
waterfall plot Creates waterfall plot for a given drug.
waterfall( object, res.measure = NULL, drug = NULL, group.by = NULL, summary.stat = c(";", "mean", "median"), x = NULL, y = NULL, type = NULL, type.color = NULL, na.value = "#878787", yname = NULL, title = NULL, sort = TRUE )
object |
The |
res.measure |
PDX model drug response measure |
drug |
Name of the drug |
group.by |
Group drug response data |
summary.stat |
How to summarize multiple values. Options are ";", "mean" or "median". See |
x, y |
If object is data.frame, x and y indicates column names of x and y axis |
type |
Type for each bar in waterfall (such as mutated or wild type). See Details. |
type.color |
A color vector for type |
na.value |
Color for NA values. Default "#878787" |
yname |
Name for the y-axis |
title |
Title of the plot |
sort |
Default |
The function waterfall can plot from a XevaSet or from a data.frame . If a data.frame is specified, x and y parameters must also be specified.
waterfall plot in ggplot2
data(brca) ##plot best.average.response for all models tested with binimetinib waterfall(brca, drug="binimetinib", res.measure="best.average.response") ##plot same by taking mean of multiple models of each patient waterfall(brca, drug="binimetinib", res.measure="best.average.response", group.by = "patient.id", summary.stat = "mean") ## plot by specifing color by mutation type ## extract mutation information mut <- summarizeData(brca,drug = "binimetinib", mDataType="mutation") model.type <- Biobase::exprs(mut)["TP53", ] ## extract data.frame of response df <- summarizeResponse(brca, response.measure = "best.average.response", return.type = "data.frame") df <- df[df$drug == "binimetinib", ] ## add values to data.frame df$TP53 <- model.type[df$model.id] ## now plot the data waterfall(df, x="model.id", y="best.average.response", type="TP53")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.