Title: | Calculate and Visualize Synergy Scores for Drug Combinations |
---|---|
Description: | Efficient implementations for analyzing pre-clinical multiple drug combination datasets. It provides efficient implementations for 1.the popular synergy scoring models, including HSA, Loewe, Bliss, and ZIP to quantify the degree of drug combination synergy; 2. higher order drug combination data analysis and synergy landscape visualization for unlimited number of drugs in a combination; 3. statistical analysis of drug combination synergy and sensitivity with confidence intervals and p-values; 4. synergy barometer for harmonizing multiple synergy scoring methods to provide a consensus metric of synergy; 5. evaluation of synergy and sensitivity simultaneously to provide an unbiased interpretation of the clinical potential of the drug combinations. Based on this package, we also provide a web application (http://www.synergyfinder.org) for users who prefer graphical user interface. |
Authors: | Shuyu Zheng [aut, cre], Jing Tang [aut] |
Maintainer: | Shuyu Zheng <[email protected]> |
License: | Mozilla Public License 2.0 |
Version: | 3.15.0 |
Built: | 2024-10-31 05:36:59 UTC |
Source: | https://github.com/bioc/synergyfinder |
This function changes the column names in other format into the style: block_id, drug1, drug2, conc1, conc2, response, conc_unit1, conc_unit2.
.AdjustColumnName(data)
.AdjustColumnName(data)
data |
A data frame. It is the input data for function ReshapeData |
The data frame with the changed column names.
Shuyu Zheng [email protected]
Jing Tang [email protected]
Bootstraping Sample from Replicates in Response Data
.Bootstrapping(response)
.Bootstrapping(response)
response |
A data frame. It contains the dose response information about one drug combination block with replicates. It must contain the columns "conc1", "conc2", ... for concentrations of drugs tested and the "response" column for observed % inhibition if cell growth. |
A data frame. It contains a full drug combination matrix whose data points are randomly selected from replicates.
Shuyu Zheng [email protected]
Jing Tang [email protected]
This function is used to calculate the distance from a point to a plane. It could also be used in high dimension spaces. The formula comes from https://en.wikipedia.org/wiki/Distance_from_a_point_to_a_plane For two dimension point, the distance to the line w1\*x+w2\*y+b = 0 For three dimension point, the distance to the plan w1\*x+w2\*y+w3\*z+b = 0
.Distance(w, b, point)
.Distance(w, b, point)
w |
A numeric vector. It contains the parameters for all the coordinates in the spaces to define the "plan". |
b |
A numeric value. It is the constant values in the formula which defines the "plane". |
point |
A numeric vector. It contains the coordinates in the spaces to define the "point". |
A numeric value. It is the distance from point defined by x0
to the "plane" defined by w
and b
Shuyu Zheng [email protected]
Jing Tang [email protected]
Make a Smooth Surface for Scores
.ExtendedScores(scores_mat, len)
.ExtendedScores(scores_mat, len)
scores_mat |
a matrix contains scores which will be visualized |
len |
length of the interval between plotted data points. |
a matrix which which contains interpolated points for input
scores_mat
.
Shuyu Zheng [email protected]
Jing Tang [email protected]
Extract Data for 2 Drug Combination Plots
.Extract2DrugPlotData( data, plot_block = 1, drugs = c(1, 2), plot_value = "response", statistic = NULL )
.Extract2DrugPlotData( data, plot_block = 1, drugs = c(1, 2), plot_value = "response", statistic = NULL )
data |
A list object generated by function |
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, |
plot_value |
A character value. It indicates the value to be visualized.
If the
If the
|
statistic |
A character or NULL. It indicates the statistics printed in the plot while there are replicates in input data. Available values are:
If it is |
A data frame. It contains the concentrations for selected drugs, the selected values for plotting, and the text for printing on the heatmap.
Shuyu Zheng [email protected]
Jing Tang [email protected]
This function extracts the information for Multi-drug plotting from input
list data
. It is an auxiliary function for PlotMultiDrugSurface
and PlotMultiDrugBar.
.ExtractMultiDrugPlotData( data, plot_block = 1, plot_value = "response", summary_statistic = NULL, statistic = NULL, titles = TRUE )
.ExtractMultiDrugPlotData( data, plot_block = 1, plot_value = "response", summary_statistic = NULL, statistic = NULL, titles = TRUE )
data |
A list object generated by function |
plot_block |
A character/integer. It indicates the block ID for the block to visualize. |
plot_value |
A vector of characters. It contains the name of one or more
metrics to be visualized. If the
If the
|
summary_statistic |
A vector of characters or NULL. It indicates the
summary statistics for all the
If it is |
statistic |
A character or NULL. It indicates the statistics printed in the plot while there are replicates in input data. Available values are:
If it is |
titles |
A logical value. If it is |
A list. It contains the elements:
plot_table A data frame contains concentrations for all
drugs, the values for plot_value
.
drug_pair A data frame contains the drug names and concentration unites, whither the block is replicate or not.
plot_subtitle A string for plot subtitle.
plot_title A string for plot title.
z_axis_subtitle A string for plot z-axis title.
Shuyu Zheng [email protected]
Jing Tang [email protected]
#' This function calculates ln(1+10^(b*(c-x))) to be used in
.ScoreCurve
function
.Own_log(b, c, x)
.Own_log(b, c, x)
b |
A numeric value. It is the fitted parameter b from
|
c |
A numeric value. It is the fitted parameter c from
|
x |
A numeric value. It is the relative IC50 for the curve. log10(e),
where e is the fitted parameter e from |
ln(1+10^(b*(c-x)))
Shuyu Zheng [email protected]
Jing Tang [email protected]
This function calculates ln(1+exp(x)) to be used in .ScoreCurve_L4 function
.Own_log2(x)
.Own_log2(x)
x |
A numeric value. It is relative IC50 for the curve. The fitted
parameter e from |
A numeric value. It is ln(1+exp(x))
Shuyu Zheng [email protected]
Jing Tang [email protected]
PredictResponseFromModel
uses drm
function to fit the
dose response model and generate the predict response value at the given dose.
.PredictResponseFromModel(model, dose)
.PredictResponseFromModel(model, dose)
model |
An object for fitted model from drm::drc function L.4 or LL.4 model. |
dose |
A numeric value. It indicates the concentration of drug at which the response will be predicted. |
Note: Random number generator used in AddNoise
with
method = "random"
. If the analysis requires reproducibility, please
set the random seed before calling this function.
A numeric value. It is the response value of cell line to the drug at inputted dose.
Shuyu Zheng [email protected]
Jing Tang [email protected]
This function converts font sizes from "pt" unite to "mm" unite.
.Pt2mm(x)
.Pt2mm(x)
x |
A numerical value. It is the font size in "pt" unite. |
A numerical value in "mm" unite
Shuyu Zheng [email protected]
Jing Tang [email protected]
This function will round the input numbers by 2 digits, if the absolute of number is larger than or equal to 1. It will take 2 significant digits, if the absolute of number is less than 1.
.RoundValues(numbers)
.RoundValues(numbers)
numbers |
A vector of numeric values. It contains the numbers need to be rounded. |
A vector of rounded numbers.
Shuyu Zheng [email protected]
Jing Tang [email protected]
New function used to score sensitivities given either a single-agent or a
fixed conc (combination) columns. The function calculates the AUC of the
log10-scaled dose-response curve. IMPORTANT: note that with
LL.4
calls, this value is already logged since the
input concentrations are logged.
.ScoreCurve(b, c, d, m, c1, c2, t)
.ScoreCurve(b, c, d, m, c1, c2, t)
b |
A numeric value, fitted parameter b from |
c |
A numeric value, fitted parameter c from |
d |
A numeric value, fitted parameter d from |
m |
A numeric value, relative IC50 for the curve. log10(e), where e is
the fitted parameter e from |
c1 |
A numeric value, log10(min conc) (this is the minimal nonzero concentration). |
c2 |
A numeric value, log10(max conc) (this is the maximal concentration). |
t |
A numeric value, threshold (usually set to zero). |
A numeric value, RI or CSS scores.
Shuyu Zheng [email protected]
Jing Tang [email protected]
This function is used to score sensitivities given either a single-agent or a fixed conc (combination) columns. The function calculates the AUC of the log10-scaled dose-response curve.
.ScoreCurve_L4(b, c, d, e, c1, c2, t)
.ScoreCurve_L4(b, c, d, e, c1, c2, t)
b |
A numeric value, fitted parameter b from |
c |
A numeric value, fitted parameter c from |
d |
A numeric value, fitted parameter d from |
e |
A numeric value, fitted parameter e from |
c1 |
A numeric value, log10(min conc) (this is the minimal nonzero concentration). |
c2 |
A numeric value, log10(max conc) (this is the maximal concentration). |
t |
A numeric value, threshold (usually set to zero). |
A numeric value, RI or CSS scores.
Shuyu Zheng [email protected]
Jing Tang [email protected]
This function will solve the fitted four-parameter logistic dose-response model and output the dose of drug at which it could achieve the % inhibition to cell growth.
.SolveExpDoesL4(y, drug_par)
.SolveExpDoesL4(y, drug_par)
y |
The expected effect (% inhibition) of the drug to cell line |
drug_par |
The parameters ("b_Hill", "c_Emin", "d_Emax", "e_log(EC50)") for fitted dose-response model. |
A numeric value. It indicates the expected dose of drug.
Shuyu Zheng [email protected]
Jing Tang [email protected]
This function will solve the fitted four-parameter log-logistic dose-response model and output the dose of drug at which it could achieve the % inhibition to cell growth.
.SolveExpDoesLL4(y, drug_par)
.SolveExpDoesLL4(y, drug_par)
y |
The expected effect (% inhibition) of the drug to cell line |
drug_par |
The parameters ("b_Hill", "c_Emin", "d_Emax", "e_EC50") for fitted dose-response model. |
A numeric value. It indicates the expected dose of drug.
Jing Tang [email protected]
Shuyu Zheng [email protected]
This function will solve the fitted dose-response model and output the dose of drug at which it could achieve the % inhibition to cell growth.
.SolveExpDose(y, drug_par, drug_type)
.SolveExpDose(y, drug_par, drug_type)
y |
The expected effect (% inhibition) of the drug to cell line. |
drug_par |
The parameters for fitted dose-response model. |
drug_type |
The type of model was used to fit the dose-response curve. Available values are "L.4" - four-parameter logistic model; "LL.4" - four-parameter log-logistic model. |
A numeric value. It indicates the expected dose of drug.
Shuyu Zheng [email protected]
Jing Tang [email protected]
Solve the Loewe Additive Effect for Concentration Combinations Isobologram
.SolveLoewe(concs, drug_par, drug_type, nsteps = 100)
.SolveLoewe(concs, drug_par, drug_type, nsteps = 100)
concs |
A numeric vector. It contains the concentrations of tested drugs. |
drug_par |
A numeric vector. The parameters in fitted dose response curve. |
drug_type |
The type of model used to fit dose response curve. |
nsteps |
The total steps to calculate concentration combinations approaching to the true Loewe effect. |
A list contains 3 items:
y_loewe the predicted Loewe additive effect which closes to .
x_select the expected concentrations for each drug to achieve y_loewe.
distance the smallest distance
Shuyu Zheng [email protected]
Jing Tang [email protected]
Bliss
calculates the synergy score matrix for a block of
drug combination by using a drug interaction reference model introduced by
C. I. Bliss in 1939.
Bliss(response)
Bliss(response)
response |
A data frame. It must contain the columns: "conc1", "conc2", ..., for the concentration of the combined drugs and "response" for the observed %inhibition at certain combination. |
This model is a reference model for evaluating the combination effect of two drugs. The basic assumption of this model is "The expected effect of two drugs acting independently". The Bliss reference effect y = 1 - product_all_drug(1-%Inhibition) * 100.
A data frame containing the concentrations for drugs, reference effect and synergy score estimated by Bliss model.
Shuyu Zheng [email protected]
Jing Tang [email protected]
Yadav B, Wennerberg K, Aittokallio T, Tang J. (2015). Searching for Drug Synergy in Complex Dose-Response Landscape Using an Interaction Potency Model. Comput Struct Biotechnol J, 13:504– 513.
Bliss, C. I. (1939). The toxicity of poisons applied jointly. Annals of Applied Biology, 26(3):585–615.
data("mathews_screening_data") data <- ReshapeData(mathews_screening_data) response <- data$response[data$response$block_id == 1, c("conc1", "conc2", "response")] Bliss.score <- Bliss(response)
data("mathews_screening_data") data <- ReshapeData(mathews_screening_data) response <- data$response[data$response$block_id == 1, c("conc1", "conc2", "response")] Bliss.score <- Bliss(response)
This function will calculate the Combination Sensitivity Score (CSS) for a drug combination block.
CalculateCSS(response, ic50)
CalculateCSS(response, ic50)
response |
A data frame. It must contain the columns: "conc1", "conc2", ..., for the concentration of the combined drugs and "response" for the observed %inhibition at certain combination. |
ic50 |
A list. It contains the relative IC50 for all the drugs in the combination. |
A data frame. It contains the CSS for each drug will one of the other drugs is at its IC50 and summarized CSS for the whole block.
Shuyu Zheng [email protected]
Jing Tang [email protected]
This function will calculate the relative IC50 from fitted 4-parameter log-logistic dose response model.
CalculateIC50(coef, type, max.conc)
CalculateIC50(coef, type, max.conc)
coef |
A numeric vector. It contains the fitted coefficients for 4-parameter log-logistic dose response model. |
type |
A character value. It indicates the type of model was used for fitting the dose-response curve. Available values are "L.4" and "LL.4". |
max.conc |
A numeric value. It indicates the maximum concentration in the dose-response data |
A numeric value. It is the relative IC50.
Shuyu Zheng [email protected]
Jing Tang [email protected]
Function CalculateRI
calculates cell line sensitivity to a drug or a
combination of drugs from dose response curve.
CalculateRI(df)
CalculateRI(df)
df |
A data frame. It contains two variables:
|
This function measures the sensitivity by calculating the Area Under Curve (AUC) according to the dose response curve. The lower border is chosen as lowest non-zero concentration in the dose response data.
A numeric value. It is the RI score for input dose-response curve.
Shuyu Zheng [email protected]
Jing Tang [email protected]
# LL.4 df <- data.frame(dose = c(0, 0.1954, 0.7812, 3.125, 12.5, 50), response = c(2.95, 3.76, 18.13, 28.69, 46.66, 58.82)) RI <- CalculateRI(df)
# LL.4 df <- data.frame(dose = c(0, 0.1954, 0.7812, 3.125, 12.5, 50), response = c(2.95, 3.76, 18.13, 28.69, 46.66, 58.82)) RI <- CalculateRI(df)
CalculateSensitivity
is the main function for calculating sensitivity
scores from the dose response matrix. It will return the RI
(relative inhibition), IC50 (relative IC50) for each drug in the combination.
It will also calculate the CSS (combination sensitivity score) for each drug
while other drugs are at their IC50 and the CSS for the whole combination
matrix.
CalculateSensitivity( data, adjusted = TRUE, correct_baseline = "non", iteration = 10, seed = 123 )
CalculateSensitivity( data, adjusted = TRUE, correct_baseline = "non", iteration = 10, seed = 123 )
data |
A list object generated by function |
adjusted |
A logical value. If it is |
correct_baseline |
A character value. It indicates the method used for baseline correction. Available values are:
|
iteration |
An integer. It indicates the number of iterations for bootstrap on data with replicates. |
seed |
An integer or NULL. It is used to set the random seed in synergy scores calculation on data with replicates. |
This function will add columns into data$drug_pairs
table.
The columns are:
ic50_1/2/... Relative IC50 for drug 1, 2, ...
ri_1/2/... Relative Inhibition (RI) for drug 1, 2, ...
css1_ic502/... CSS score of drug 1 while fixing drug 2 at its IC50.
css Over all CSS score for the whole block. It's the mean value of the CSS for all drug pairs in the combination.
If there are replicates in the block, this function will add one table named
as "sensitivity_scores_statistics" for the statistics of the values
mentioned about into the input data
list.
Shuyu Zheng [email protected]
Jing Tang [email protected]
data("ONEIL_screening_data") data <- ReshapeData(ONEIL_screening_data, data_type = "inhibition") data <- CalculateSensitivity(data)
data("ONEIL_screening_data") data <- ReshapeData(ONEIL_screening_data, data_type = "inhibition") data <- CalculateSensitivity(data)
CalculateSynergy
is the main function for calculating synergy scores
based on model(ZIP, Bliss, Loewe, and HSA) from one dose-response matrix.
CalculateSynergy( data, method = c("ZIP", "HSA", "Bliss", "Loewe"), Emin = NA, Emax = NA, adjusted = TRUE, correct_baseline = "non", iteration = 10, seed = 123 )
CalculateSynergy( data, method = c("ZIP", "HSA", "Bliss", "Loewe"), Emin = NA, Emax = NA, adjusted = TRUE, correct_baseline = "non", iteration = 10, seed = 123 )
data |
A list object generated by function |
method |
A vector of characters. It is used to specify the reference models used to calculate the synergy scores. Choices are "ZIP", "Bliss", "HSA" and "Loewe". Default setting is to calculate all the available models. |
Emin |
The expected minimum response value in the 4 parameter
log-logistic model. It is used while calling |
Emax |
The expected maximum response value in the 4 parameter
log-logistic model. It is used while calling |
adjusted |
A logical value. If it is |
correct_baseline |
A character value. It indicates the method used for baseline correction. Available values are:
|
iteration |
An integer value. It indicates the number of iterations for bootstrap on data with replicates. |
seed |
An integer or NULL. It is used to set the random seed in synergy scores calculation on data with replicates. |
This function will add 1 or 2 elements into inputted data
list:
scores A data frame. It contains synergy scores,
reference effects and fitted response values (only for "ZIP" model)
calculated by selected method
. If there are replicates in the
block, the mean values across all iterations for all the metrics
mentioned above will be output.
scores_statistics A data frame. It will be output if there is block have replicated response values. It contains the the statistics (including mean, standard deviation, standard error of mean and 95 and fitted response values (only for "ZIP" model) across results from iterations.
This function also add mean of synergy scores across whole combination
matrix to the data$drug_pair
table.
Shuyu Zheng [email protected]
Jing Tang [email protected]
data("mathews_screening_data") data <- ReshapeData(mathews_screening_data) scores <- CalculateSynergy(data)
data("mathews_screening_data") data <- ReshapeData(mathews_screening_data) scores <- CalculateSynergy(data)
CorrectBaseLine
adjusts the base line of drug combination
dose-response matrix to make it closer to 0.
CorrectBaseLine(response, method = c("non", "part", "all"))
CorrectBaseLine(response, method = c("non", "part", "all"))
response |
A drug combination dose-response matrix. It's column name and row name are representing the concentrations of drug added to column and row, respectively. The values in matrix indicate the inhibition rate to cell growth. |
method |
A character value. It indicates the method used for baseline correction. Available values are:
|
A matrix which base line have been adjusted.
Shuyu Zheng [email protected]
Jing Tang [email protected]
data("mathews_screening_data") data <- ReshapeData(mathews_screening_data) response <- data$response[data$response$block_id == 1, ] adjusted <- CorrectBaseLine(response, method = "part")
data("mathews_screening_data") data <- ReshapeData(mathews_screening_data) response <- data$response[data$response$block_id == 1, ] adjusted <- CorrectBaseLine(response, method = "part")
This function will take the multi-drug combination data, project the concentrations of all the drugs into 2 dimensions. It is an auxiliary function for PlotMultiDrugSurface
DimensionReduction( plot_table, drug_pair, plot_value, distance_method = "mahalanobis" )
DimensionReduction( plot_table, drug_pair, plot_value, distance_method = "mahalanobis" )
plot_table |
A data frame contains concentrations for all drugs, the
values for |
drug_pair |
A data frame contains the drug names and concentration unites, whither the block is replicate or not. |
plot_value |
A vector of characters. It contains the name of one or more
metrics to be visualized. If the
If the
|
distance_method |
The methods to calculate the distance between
different data points from the concentration of drugs. The distance matrix
is used for dimension reduction. This parameter is used to set the
parameter |
A data frame. It contains the plot information required by function GenerateSurface
Shuyu Zheng [email protected]
Jing Tang [email protected]
ExtractSingleDrug
extracts the dose-response values of single drug
from a drug combination dose-response matrix.
ExtractSingleDrug(response)
ExtractSingleDrug(response)
response |
A data frame. It must contain the columns: "conc1", "conc2", ..., for the concentration of the combined drugs and "response" for the observed %inhibition at certain combination. |
A list contains several data frames each of which contains 2 columns:
dose The concertration of drug.
response The cell's response (inhibation rate) to corresponding drug concertration.
Shuyu Zheng [email protected]
Jing Tang [email protected]
data("mathews_screening_data") data <- ReshapeData(mathews_screening_data) response <- data$response[data$response$block_id == 1, c("conc1", "conc2", "response")] single <- ExtractSingleDrug(response)
data("mathews_screening_data") data <- ReshapeData(mathews_screening_data) response <- data$response[data$response$block_id == 1, c("conc1", "conc2", "response")] single <- ExtractSingleDrug(response)
Find the Fitted Parameters from 4-Parameter Log-Logistic Model
FindModelPar(model)
FindModelPar(model)
model |
A object of class "drc". |
A numeric vector. It contains 4 fitted parameters.
FindModelType
will extract the model type ("LL.4" or "L.4) eventually
used in funciton FitDoseResponse
FindModelType(model)
FindModelType(model)
model |
An object of class 'drc'. It is generated by function
|
A character either "LL.4" or "L.4". It indicates the type of model used for fitting dose response data.
Shuyu Zheng [email protected]
Jing Tang [email protected]
df <- data.frame( response = c(0, 29, 59, 60, 75, 90), dose = c(0.00, 9.7656, 39.0626, 156.25, 625, 2500) ) model <- FitDoseResponse(df) model.type <- FindModelType(model)
df <- data.frame( response = c(0, 29, 59, 60, 75, 90), dose = c(0.00, 9.7656, 39.0626, 156.25, 625, 2500) ) model <- FitDoseResponse(df) model.type <- FindModelType(model)
Function FitDoseResponse
fits dose-response model by using
drm
function.
FitDoseResponse(data, Emin = NA, Emax = NA)
FitDoseResponse(data, Emin = NA, Emax = NA)
data |
A data frame. It contains two columns:
|
Emin |
A numeric value or |
Emax |
A numeric or |
Pre-fitting process: 1. Change the 0 value in concentration into 10^-10 to avoide raising error when taking log. 2. If the variance of "response" values equal to 0, add 10^-10 to the last "response" value.
Model choice:
First use "L.4" model to fit the raw data. If error or waring occurs, use
"LL.4" model to fit log(raw data)
.
An object of class 'drc'. It contains information of fitted model.
Shuyu Zheng [email protected]
Jing Tang [email protected]
Seber, G. A. F. and Wild, C. J (1989) hrefhttps://onlinelibrary.wiley.com/doi/book/10.1002/0471725315Nonlinear Regression, New York: Wiley \& Sons (p. 330).
df <- data.frame( response = c(0, 29, 59, 60, 75, 90), dose = c(0.00, 9.7656, 39.0626, 156.25, 625, 2500) ) model <- FitDoseResponse(df)
df <- data.frame( response = c(0, 29, 59, 60, 75, 90), dose = c(0.00, 9.7656, 39.0626, 156.25, 625, 2500) ) model <- FitDoseResponse(df)
This function will generate a surface plot for multi-drug combinations from the output of DimensionReduction. It is an auxiliary function for PlotMultiDrugSurface
GenerateSurface( dim_reduced_data, high_value_color, low_value_color, show_data_points = TRUE, point_color, plot_title, plot_subtitle, legend_title, z_axis_title, text_size_scale = 1, axis_line = FALSE, colorbar_tick = FALSE, x_range = NULL, y_range = NULL, z_range = NULL, color_range = NULL, camera_width = NULL, camera_height = NULL, camera_scale = 1 )
GenerateSurface( dim_reduced_data, high_value_color, low_value_color, show_data_points = TRUE, point_color, plot_title, plot_subtitle, legend_title, z_axis_title, text_size_scale = 1, axis_line = FALSE, colorbar_tick = FALSE, x_range = NULL, y_range = NULL, z_range = NULL, color_range = NULL, camera_width = NULL, camera_height = NULL, camera_scale = 1 )
dim_reduced_data |
A list of data frame. It contains the dimension reduced data for all the data points and other information for plotting. It is the output of DimensionReduction (combination of concentrations). It is |
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. |
show_data_points |
A logical value. If it is |
point_color |
An R color value. It indicates the color for data points. |
plot_title |
A character value. It is the title for plot. |
plot_subtitle |
A character value. It is the subtitle for plot. |
legend_title |
A character value. It is the title for legend. |
z_axis_title |
A character value. It is the title for z-axis. |
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. |
axis_line |
A logical value. Whether to show the axis lines and ticks. |
colorbar_tick |
A logical value. Whether to show the ticks on color bar. |
x_range |
A numeric vector with two values or NULL. It is used to set
the range of x axis (coordinate 1). For example, |
y_range |
A numeric vector with two values or NULL. It is used to set
the range of y axis (coordinate 2). For example, |
z_range |
A vector of two numeric values. They specify the range of
z-axis plotted.Default value is |
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 |
camera_width |
A numeric value or NULL. It indicates the output figure's width on pixel. |
camera_height |
A numeric value or NULL. It indicates the output figure's height on pixel. |
camera_scale |
A numeric value. The output plot will multiply title/legend/axis/canvas sizes by this factor. |
A ggplot object.
Shuyu Zheng [email protected]
Jing Tang [email protected]
It is an auxiliary function for PlotMultiDrugBar
HighlightBarPlot(selected_data, text_size = 10)
HighlightBarPlot(selected_data, text_size = 10)
selected_data |
A data frame. It contain the information for the bars to be highlighted. |
text_size |
A numeric value. It indicates the label text size in "pt" for the highlighted row. |
A ggplot object
Shuyu Zheng [email protected]
Jing Tang [email protected]
HSA
calculates the synergy score matrix for a block of
drug combination by using Highest Single Agent (HSA) reference model.
HSA(response)
HSA(response)
response |
A data frame. It must contain the columns: "conc1", "conc2", ..., for the concentration of the combined drugs and "response" for the observed %inhibition at certain combination. |
This model is a reference model for evaluating the combination effect of two drugs. The basic assumption of this model is "The reference effect of drug combination is the maximal single drug effect".
A data frame containing the concentrations for drugs, reference effect and synergy score estimated by HSA model.
Shuyu Zheng [email protected]
Jing Tang [email protected]
Yadav B, Wennerberg K, Aittokallio T, Tang J.(2015). Searching for Drug Synergy in Complex Dose-Response Landscape Using an Interaction Potency Model.Comput Struct Biotechnol J, 13:504– 513.
Berenbaum MC. (1989). What is synergy? Pharmacol Rev 1990 Sep;41(3):422.
data("mathews_screening_data") data <- ReshapeData(mathews_screening_data) response <- data$response[data$response$block_id == 1, c("conc1", "conc2", "response")] HSA.score <- HSA(response)
data("mathews_screening_data") data <- ReshapeData(mathews_screening_data) response <- data$response[data$response$block_id == 1, c("conc1", "conc2", "response")] HSA.score <- HSA(response)
ImputeIC50
uses the particular experiment's values to predict the
missing values at the desired IC50 concentration of the drug.
This function is only called when trying to fix a drug at its selected IC50
concentration where the response values have not been tested in experiment.
ImputeIC50(response.mat, col.ic50, row.ic50)
ImputeIC50(response.mat, col.ic50, row.ic50)
response.mat |
A matrix. It contains response value of a block of drug combination. |
col.ic50 |
A numeric value. The IC50 value of drug added to columns. |
row.ic50 |
A numeric value. The IC50 value of drug added to rows. |
ImputeIC50
fits dose-response models (with drm
function) by fixing the concentrations of the
other drug successively, and uses each fit to predict the missing
value at the combination (missing IC50, fixed conc).
A data frame contains all response value at the IC50 concentration
of certein drug. It could be directly passed to function
CalculateRI
for scoring.
Shuyu Zheng [email protected]
Jing Tang [email protected]
Loewe
calculates the synergy score matrix from a dose-response matrix
by using a druginteraction reference model introduced by Loewe in 1953.
Loewe(response, Emin = NA, Emax = NA, quiet = TRUE)
Loewe(response, Emin = NA, Emax = NA, quiet = TRUE)
response |
A data frame. It must contain the columns: "conc1", "conc2", ..., for the concentration of the combined drugs and "response" for the observed %inhibition at certain combination. |
Emin |
The expected minimum response value in the 4 parameter log-logistic model. |
Emax |
The expected maximum response value in the 4 parameter log-logistic model. |
quiet |
A logical value. If it is |
Loewe model is a reference model for evaluating the combination
effect of two drugs. The basic assumption of this model is "The referece
effect of drug combination is the expected effect of a drug combined with
itself".
The optional arguments drug.col.model
, drug.row.model
are
designed for reuse the single drug dose response model fitting results,
if it has been down before. Functions FitDoseResponse
and
ExtractSingleDrug
could be used to calculate these arguments.
A data frame containing the concentrations for drugs, reference effect and synergy score estimated by Loewe model.
Shuyu Zheng [email protected]
Jing Tang [email protected]
Yadav B, Wennerberg K, Aittokallio T, Tang J.(2015). Searching for Drug Synergy in Complex Dose-Response Landscape Using an Interaction Potency Model.Comput Struct Biotechnol J, 13:504– 513.
[Loewe, 1953] Loewe, S. (1953). The problem of synergism and antagonism of combined drugs. Arzneimittelforschung, 3(6):285–290.
data("mathews_screening_data") data <- ReshapeData(mathews_screening_data) response <- data$response[data$response$block_id == 1, c("conc1", "conc2", "response")] Loewe.score <- Loewe(response)
data("mathews_screening_data") data <- ReshapeData(mathews_screening_data) response <- data$response[data$response$block_id == 1, c("conc1", "conc2", "response")] Loewe.score <- Loewe(response)
A recent drug combination screening for the treatment of diffuse large B-cell lymphoma (DLBCL).
A data frame with the following columns: block_id, drug_row, drug_col, conc_r, conc_c, response, conc_r_unit, conc_c_unit.
Mathews Griner LA, Guha R, Shinn P, Young RM, Keller JM, et al. High-throughput combinatorial screening identifies drugs that cooperate with ibrutinib to kill activated B-cell-like diffuse large B-cell lymphoma cells. Proc Natl Acad Sci USA 2014; 111:2349-54.
A 3-drug combination screening data on Malaria. It is downloaded from [NCATS Matrix](https://matrix.ncats.nih.gov/) project 2321 "Malaria TACT". It contains 2 blocks, one is synergistic and the other is antagonistic.
A data frame with the following columns: "block_id", "drug1", "drug2", "drug3", "conc1", "conc2", "conc3", "response", "conc_unit1", "conc_unit2", "conc_unit3"
A 2-drug combination screening data on cancer cell lines. It is from publication [(O'Neil, 2016)](https://pubmed.ncbi.nlm.nih.gov/26983881/). It contains 2 blocks, one is synergistic and the other is antagonistic.
A data frame with the following columns: "block_id", "drug1", "drug2", "cell_line_name", "conc1", "conc2", "response", "conc_unit1", "conc_unit2"
O’Neil, J., Benita, Y., Feldman, I., Chenard, M., Roberts, B., Liu, Y., Li, J., Kral, A., Lejnine, S., Loboda, A., Arthur, W., Cristescu, R., Haines, B.B., Winter, C., Zhang, T., Bloecher, A., Shumway, S.D., 2016. An Unbiased Oncology Compound Screen to Identify Novel Combination Strategies. Mol Cancer Ther 15, 1155–1162.
This function will generate a contour level plot for 2-drug combinations. The axes are the dosage for each drug. The values could be observed response, synergy scores or the reference effects calculated from different models.
Plot2DrugContour( data, plot_block = 1, drugs = c(1, 2), plot_value = "response", interpolate_len = 2, summary_statistic = NULL, dynamic = FALSE, grid = TRUE, plot_title = NULL, axis_line = FALSE, col_range = NULL, row_range = NULL, color_range = NULL, high_value_color = "#FF0000", low_value_color = "#00FF00", text_size_scale = 1 )
Plot2DrugContour( data, plot_block = 1, drugs = c(1, 2), plot_value = "response", interpolate_len = 2, summary_statistic = NULL, dynamic = FALSE, grid = TRUE, plot_title = NULL, axis_line = FALSE, col_range = NULL, row_range = NULL, color_range = NULL, high_value_color = "#FF0000", low_value_color = "#00FF00", text_size_scale = 1 )
data |
A list object generated by function |
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, |
plot_value |
A character value. It indicates the score or response value
to be visualized. If the
If the
|
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. |
summary_statistic |
A vector of characters or NULL. It indicates the
summary statistics for all the
If it is |
dynamic |
A logical value. If it is |
grid |
A logical value. It indicates whether to add grids. |
plot_title |
A character value. It specifies the plot title. If it is
|
axis_line |
A logical value. Whether to show the axis lines and ticks. |
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 |
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 |
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 |
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. |
If dynamic = FALSE
, this function will return a plot project
recorded by recordPlot. If dynamic = FALSE
, this
function will return a plotly plot object.
Shuyu Zheng [email protected]
Jing Tang [email protected]
data("mathews_screening_data") data <- ReshapeData(mathews_screening_data) Plot2DrugContour(data)
data("mathews_screening_data") data <- ReshapeData(mathews_screening_data) Plot2DrugContour(data)
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.
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 )
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 )
data |
A list object generated by function |
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, |
plot_value |
A character value. It indicates the value to be visualized.
If the
If the
|
statistic |
A character or NULL. It indicates the statistics printed in the plot while there are replicates in input data. Available values are:
If it is |
summary_statistic |
A vector of characters or NULL. It indicates the
summary statistics for all the
If it is |
dynamic |
A logical value. If it is |
plot_title |
A character value. It specifies the plot title. If it is
|
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 |
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 |
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 |
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 |
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. |
A ggplot plot object.
Shuyu Zheng [email protected]
Jing Tang [email protected]
data("mathews_screening_data") data <- ReshapeData(mathews_screening_data) Plot2DrugHeatmap(data)
data("mathews_screening_data") data <- ReshapeData(mathews_screening_data) Plot2DrugHeatmap(data)
This function will generate a surface plot for 2-drug combinations. The axes are the dosage for each drug. The values could be observed response, synergy scores or the reference effects calculated from different models.
Plot2DrugSurface( data, plot_block = 1, drugs = c(1, 2), plot_value = "response", summary_statistic = NULL, plot_title = NULL, interpolate_len = 2, axis_line = FALSE, col_range = NULL, row_range = NULL, z_range = NULL, color_range = NULL, dynamic = FALSE, grid = TRUE, high_value_color = "#FF0000", low_value_color = "#00FF00", text_size_scale = 1 )
Plot2DrugSurface( data, plot_block = 1, drugs = c(1, 2), plot_value = "response", summary_statistic = NULL, plot_title = NULL, interpolate_len = 2, axis_line = FALSE, col_range = NULL, row_range = NULL, z_range = NULL, color_range = NULL, dynamic = FALSE, grid = TRUE, high_value_color = "#FF0000", low_value_color = "#00FF00", text_size_scale = 1 )
data |
A list object generated by function |
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, |
plot_value |
A character value. It indicates the score or response value
to be visualized. If the
If the
|
summary_statistic |
A vector of characters or NULL. It indicates the
summary statistics for all the
If it is |
plot_title |
A character value. It specifies the plot title. If it is
|
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. |
axis_line |
A logical value. It specifies whether to show the axis lines and ticks in dynamic plot. Axis lines are always shown in the static plot. |
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 |
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 |
z_range |
A vector of two numeric values. They specify the range of
z-axis plotted.Default value is |
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 |
dynamic |
A logical value. If it is |
grid |
A logical value. It indicates whether to add grids on the surface. |
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. |
If dynamic = FALSE
, this function will return a plot project
recorded by recordPlot. If dynamic = FALSE
, this
function will return a plotly plot object.
Shuyu Zheng [email protected]
Jing Tang [email protected]
data("mathews_screening_data") data <- ReshapeData(mathews_screening_data) Plot2DrugSurface(data) Plot2DrugSurface(data, dynamic = TRUE)
data("mathews_screening_data") data <- ReshapeData(mathews_screening_data) Plot2DrugSurface(data) Plot2DrugSurface(data, dynamic = TRUE)
This function will plot a barometer. The needle will point at the response
(% inhibition) at the data point specified by plot_concs
. The
reference additive effects calculated by different models will be marked on
the bar if they are included in input data
.
PlotBarometer( data, plot_block = 1, plot_concs, graduation_color = "#6C6C6C", needle_color = "#6C6C6C", needle_text_size = 5, needle_text_offset = 2, graduation_label_size = 4, graduation_label_offset = 0.7, annotation_label_size = 4, annotation_label_offset = 0.6, annotation_label_color = "#6C6C6C", font_family = "", color_bar_color = "#8f1b01", color_bar_outer = 9, color_bar_inner = 8, major_graduation_outer = 7.8, minor_graduation_inner = 7.5, major_graduation_inner = 7, show_concs = TRUE )
PlotBarometer( data, plot_block = 1, plot_concs, graduation_color = "#6C6C6C", needle_color = "#6C6C6C", needle_text_size = 5, needle_text_offset = 2, graduation_label_size = 4, graduation_label_offset = 0.7, annotation_label_size = 4, annotation_label_offset = 0.6, annotation_label_color = "#6C6C6C", font_family = "", color_bar_color = "#8f1b01", color_bar_outer = 9, color_bar_inner = 8, major_graduation_outer = 7.8, minor_graduation_inner = 7.5, major_graduation_inner = 7, show_concs = TRUE )
data |
A list object generated by function
|
plot_block |
An integer or character. It indicates the block id for the combination matrix to visualize. |
plot_concs |
A vector of numeric values with the length same as the number of drugs in selected block. It contains the concentrations for "drug1", "drug2", ... The data point selected by these concentrations will be highlighted in the plot. |
graduation_color |
An R color value. It indicates the color of the graduation texts and ticks. |
needle_color |
An R color value. It indicates the color of the needle. |
needle_text_size |
A numeric value. It indicates the size of the text near the center of barometer which showing the response value. The unit is "mm". |
needle_text_offset |
A numeric value. It is used to set the position of the response values text. Smaller value means the text is closer to the center. |
graduation_label_size |
A numeric value. It indicates the size of the graduation texts. The unit is "mm". |
graduation_label_offset |
A numeric value. It is used to set the position of graduation texts. Smaller values means the graduation texts is closer to the ticks. It ranges from 0 to 1. |
annotation_label_size |
A numeric value. It indicates the size of the labels for the additive effects at the out-most layer. The unit is "mm". |
annotation_label_offset |
A numeric value. It is used to set the position of additive effect labels. Smaller values means the labels is closer to the color bar. It ranges from 0 to 1. |
annotation_label_color |
An R color value. It indicates the color of the additive effects at the out-most layer. |
font_family |
The font family for all the texts in the plot. |
color_bar_color |
An R color value. It indicates the color of the largest value in the color bar. |
color_bar_outer |
A numerical value. It indicates the proportion of the radius for the outer side of color bar comparing to the outermost edge for plotting area. It ranges from 0 to 1. |
color_bar_inner |
A numerical value. It indicates the proportion of the radius for the inner side of color bar comparing to the outermost edge for plotting area. It ranges from 0 to 1. |
major_graduation_outer |
A numerical value. It indicates the proportion of the radius for the outer side of graduation comparing to the outermost edge for plotting area. It ranges from 0 to 1. |
minor_graduation_inner |
A numerical value. It indicates the proportion of the radius for the outer side of graduation comparing to the outermost edge for plotting area. It ranges from 0 to 1. |
major_graduation_inner |
A numerical value. It indicates the proportion of the radius for the outer side of graduation comparing to the outermost edge for plotting area. It ranges from 0 to 1. |
show_concs |
A logical value. If it is |
A ggplot object.
Shuyu Zheng [email protected]
Jing Tang [email protected]
Tang J, Wennerberg K and Aittokallio T (2015) hrefhttps://www.frontiersin.org/articles/10.3389/fphar.2015.00181/fullWhat is synergy? The Saariselkä agreement revisited. Front. Pharmacol. 6:181. doi: 10.3389/fphar.2015.00181
data("mathews_screening_data") data <- ReshapeData(mathews_screening_data) data <- CalculateSynergy(data, method = c("ZIP", "HSA", "Bliss", "Loewe")) p <- PlotBarometer(data, plot_block = 1, c(625, 50)) p
data("mathews_screening_data") data <- ReshapeData(mathews_screening_data) data <- CalculateSynergy(data, method = c("ZIP", "HSA", "Bliss", "Loewe")) p <- PlotBarometer(data, plot_block = 1, c(625, 50)) p
A function to visualize the drug combination dose-response data
PlotDoseResponse( data, block_ids = c(1), drugs = c(1, 2), adjusted = TRUE, statistic = NULL, summary_statistic = "mean", high_value_color = "#FF0000", low_value_color = "#00FF00", point_color = "#C24B40", curve_color = "black", curve_ylim = NULL, curve_grid = TRUE, text_size_scale = 1, heatmap_text_label_size_scale = 1, heatmap_text_label_color = "#000000", heatmap_color_range = NULL, curve_plot_title = NULL, heatmap_plot_title = NULL, Emin = NA, Emax = NA, save_file = FALSE, file_type = "pdf", file_name = NULL, width = 12, height = 6 )
PlotDoseResponse( data, block_ids = c(1), drugs = c(1, 2), adjusted = TRUE, statistic = NULL, summary_statistic = "mean", high_value_color = "#FF0000", low_value_color = "#00FF00", point_color = "#C24B40", curve_color = "black", curve_ylim = NULL, curve_grid = TRUE, text_size_scale = 1, heatmap_text_label_size_scale = 1, heatmap_text_label_color = "#000000", heatmap_color_range = NULL, curve_plot_title = NULL, heatmap_plot_title = NULL, Emin = NA, Emax = NA, save_file = FALSE, file_type = "pdf", file_name = NULL, width = 12, height = 6 )
data |
A list object generated by function |
block_ids |
A vector of characters/integers or NULL. It contains the
block IDs for the blocks to visualize. By default, it is NULL so that the
visualization of all the drug combinations in input |
drugs |
A vector of characters or integers with length of 2. It contains
the index for two drugs to plot. For example, |
adjusted |
A logical value. If it is |
statistic |
A character or NULL. It indicates the statistics printed in the plot while there are replicates in input data. Available values are:
If it is |
summary_statistic |
A vector of characters or NULL. It indicates the
summary statistics printed in heatmap for all the
If it is |
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. |
point_color |
An R color value. It indicates the color for points in dose response curve plots. |
curve_color |
An R color value. It indicates the color for curves in dose response curve plots. |
curve_ylim |
A vector of two numeric values or |
curve_grid |
A logical value. It indicates whether to add grids on the dose-response curve pot. |
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
|
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 |
heatmap_color_range |
A vector of two numeric values. They specify the
range of the color bar in heatmap plot. 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 |
curve_plot_title |
A character value to indicate the plot title for the dose-response curve. |
heatmap_plot_title |
A character value to indicate the plot title for the heatmap. |
Emin |
A numeric or |
Emax |
A numeric or |
save_file |
A parameter to specify if the visualization results are saved as pdf files in current working directory or not. If it is FALSE, the results are returned as a list of the plots. It is FALSE by default. |
file_type |
A character. It indicates the format of files you want to save as. Default is "pdf". Available values are "jpeg", "bmp", "png", "tiff", "pdf", "svg". |
file_name |
A character vector. It indicates the file names, if user chose to save the plot to local directory.If it is not defined by user, a default name will be assigned. |
width |
a numeric value. It indicates the width of saved file. |
height |
a numeric value. It indicates the height of saved file. |
A list of plot objects recorded by recordPlot. The
plot will be saved into a local file if save_file = TRUE
. If
save_file = FALSE
, the plot will be printed in default graphic
device.
Shuyu Zheng [email protected]
Jing Tang [email protected]
## Not run: data("mathews_screening_data") data <- ReshapeData(mathews_screening_data) plots <- PlotDoseResponse(data) ## End(Not run)
## Not run: data("mathews_screening_data") data <- ReshapeData(mathews_screening_data) plots <- PlotDoseResponse(data) ## End(Not run)
This function will pot the dose response curve fitted by 4 parameters log-logistic curve.
PlotDoseResponseCurve( data, plot_block = 1, drug_index = 1, adjusted = TRUE, Emin = NA, Emax = NA, grid = TRUE, point_color = "#C24B40", curve_color = "black", text_size_scale = 1, plot_title = NULL, plot_subtitle = NULL, plot_setting = list(cex.lab = 1 * text_size_scale, mgp = c(2, 0.5, 0), font.main = 2, font.lab = 1, cex.main = 14/12 * text_size_scale, bty = "l", lwd = 1.5), plot_new = TRUE, record_plot = TRUE, ... )
PlotDoseResponseCurve( data, plot_block = 1, drug_index = 1, adjusted = TRUE, Emin = NA, Emax = NA, grid = TRUE, point_color = "#C24B40", curve_color = "black", text_size_scale = 1, plot_title = NULL, plot_subtitle = NULL, plot_setting = list(cex.lab = 1 * text_size_scale, mgp = c(2, 0.5, 0), font.main = 2, font.lab = 1, cex.main = 14/12 * text_size_scale, bty = "l", lwd = 1.5), plot_new = TRUE, record_plot = TRUE, ... )
data |
A list object generated by function |
plot_block |
A character/integer. It indicates the block ID for the block to visualize. |
drug_index |
A character/integer. It indicates the index of the drug to
plot. For example, 1 or "1" indicates to plot "drug1" in the input
|
adjusted |
A logical value. If it is |
Emin |
A numeric or |
Emax |
A numeric or |
grid |
A logical value. It indicates whether to show the grids in the
plots. The default value is |
point_color |
An R color value. It indicates the color for points in dose response curve plots. |
curve_color |
An R color value. It indicates the color for curves in dose response curve plots. |
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. |
plot_title |
A character value or NULL. It specifies the plot title.
If it is |
plot_subtitle |
A character or NULL. It indicates the subtitle for the
plot. If it is |
plot_setting |
A list of graphical arguments. The arguments are passed to par function to modify the appearance of plots. |
plot_new |
A logic value. If it is |
record_plot |
A logic value. If it is |
... |
Additional graphical arguments that are inherited from link[drc]plot.drc function. For example, use xlim = c(0.5, 500) or ylim = (0, 100) to control the ranges of x-axis or y-axis, respectively. |
A plot object recorded by recordPlot or NULL.
Shuyu Zheng [email protected]
Jing Tang [email protected]
data("mathews_screening_data") data <- ReshapeData(mathews_screening_data) p <- PlotDoseResponseCurve(data, plot_block = 1, drug_index = 2, grid = NULL) replayPlot(p)
data("mathews_screening_data") data <- ReshapeData(mathews_screening_data) p <- PlotDoseResponseCurve(data, plot_block = 1, drug_index = 2, grid = NULL) replayPlot(p)
This function will generate a group of bar plots for one drug combination
block. Each panel (columns) visualize the concentrations for all the drugs
and metrics specified by plot_values
. Each row represents a data point
in the combination data. The data point specified by highlight_row
will be highlighted in different color.
PlotMultiDrugBar( data, plot_block = 1, plot_value = c("response", "response_origin"), sort_by = "response", highlight_row = NULL, pos_value_color = "#CC3311", neg_value_color = "#448BD4", highlight_pos_color = "#A90217", highlight_neg_color = "#2166AC", panel_title_size = 10, axis_text_size = 10, highlight_label_size = 5, data_table = FALSE )
PlotMultiDrugBar( data, plot_block = 1, plot_value = c("response", "response_origin"), sort_by = "response", highlight_row = NULL, pos_value_color = "#CC3311", neg_value_color = "#448BD4", highlight_pos_color = "#A90217", highlight_neg_color = "#2166AC", panel_title_size = 10, axis_text_size = 10, highlight_label_size = 5, data_table = FALSE )
data |
A list object generated by function |
plot_block |
A character/integer. It indicates the block ID for the block to visualize. |
plot_value |
A vector of characters. It contains the name of one or more
metrics to be visualized. If the
If the
|
sort_by |
A character. It indicates by which metric the bars (data
points) will be sorted. It could be one of the available values for
|
highlight_row |
A vector of numeric values with the length same as the number of drugs in selected block. It contains the concentrations for "drug1", "drug2", ... The data point selected by these concentrations will be highlighted in the plot. |
pos_value_color |
An R color value. It indicates the color for the positive values. |
neg_value_color |
An R color value. It indicates the color for the negative values. |
highlight_pos_color |
An R color value. It indicates the highlight color for the positive values. |
highlight_neg_color |
An R color value. It indicates the highlight color for the negative values. |
panel_title_size |
A numeric value. It indicates the size of panel titles in unit "mm". |
axis_text_size |
A numeric value. It indicates the size of axis texts in unit "mm". |
highlight_label_size |
A numeric value. It indicates the size of the labels for highlighted rows in unit "mm". |
data_table |
A logic value. If it is |
A ggplot object. If data_table = TRUE
, the output will be a
list containing a ggplot object and a data frame used for plotting.
Shuyu Zheng [email protected]
Jing Tang [email protected]
data("NCATS_screening_data") data <- ReshapeData(NCATS_screening_data) data <- CalculateSynergy(data, method = c("HSA")) p <- PlotMultiDrugBar(data, plot_block = 1, plot_value = c("response", "HSA_ref", "HSA_synergy"), highlight_row = c(0, 0, 0), sort_by = "HSA_synergy" ) p
data("NCATS_screening_data") data <- ReshapeData(NCATS_screening_data) data <- CalculateSynergy(data, method = c("HSA")) p <- PlotMultiDrugBar(data, plot_block = 1, plot_value = c("response", "HSA_ref", "HSA_synergy"), highlight_row = c(0, 0, 0), sort_by = "HSA_synergy" ) p
This function will generate a dynamic 3D plot response values or synergy
scores for all the observed data points in a multi-drug combination block.
The concentrations of drugs will be projected to 2 dimensions and plot along
x an y axis. A surface for the selected plot_value
and points for
all the concentration combinations will be plotted.
PlotMultiDrugSurface( data, plot_block = 1, plot_value = "response", summary_statistic = NULL, plot_title = NULL, distance_method = "mahalanobis", high_value_color = "#FF0000", low_value_color = "#00FF00", show_data_points = TRUE, point_color = "#DDA137", text_size_scale = 1, axis_line = FALSE, colorbar_tick = FALSE, x_range = NULL, y_range = NULL, z_range = NULL, color_range = NULL, camera_width = NULL, camera_height = NULL, camera_scale = 1 )
PlotMultiDrugSurface( data, plot_block = 1, plot_value = "response", summary_statistic = NULL, plot_title = NULL, distance_method = "mahalanobis", high_value_color = "#FF0000", low_value_color = "#00FF00", show_data_points = TRUE, point_color = "#DDA137", text_size_scale = 1, axis_line = FALSE, colorbar_tick = FALSE, x_range = NULL, y_range = NULL, z_range = NULL, color_range = NULL, camera_width = NULL, camera_height = NULL, camera_scale = 1 )
data |
A list object generated by function |
plot_block |
A character/integer. It indicates the block ID for the block to visualize. |
plot_value |
A vector of characters. It contains the name of one or more
metrics to be visualized. If the
If the
|
summary_statistic |
A vector of characters or NULL. It indicates the
summary statistics for all the
If it is |
plot_title |
A charactor value. It specifies the plot title. If it is
|
distance_method |
The methods to calculate the distance between
different data points from the concentration of drugs. The distance matrix
is used for dimension reduction. This parameter is used to set the
parameter |
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. |
show_data_points |
A logical value. If it is |
point_color |
An R color value. It indicates the color for data points. |
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. |
axis_line |
A logical value. Whether to show the axis lines and ticks. |
colorbar_tick |
A logical value. Whether to show the ticks on color bar. |
x_range |
A numeric vector with two values or NULL. It is used to set
the range of x axis (coordinate 1). For example, |
y_range |
A numeric vector with two values or NULL. It is used to set
the range of y axis (coordinate 2). For example, |
z_range |
A vector of two numeric values. They specify the range of
z-axis plotted.Default value is |
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 |
camera_width |
A numeric value or NULL. It indicates the output figure's width on pixel. |
camera_height |
A numeric value or NULL. It indicates the output figure's height on pixel. |
camera_scale |
A numeric value. The output plot while clicking the camera button.will multiply title/legend/axis/canvas sizes by this factor. |
A plotly plot object.
Shuyu Zheng [email protected]
Jing Tang [email protected]
data("NCATS_screening_data") data <- ReshapeData(NCATS_screening_data) p <- PlotMultiDrugSurface( data, plot_block = 1, plot_value = "response", show_data_points = TRUE, distance_method = "mahalanobis", summary_statistic = "mean" ) p
data("NCATS_screening_data") data <- ReshapeData(NCATS_screening_data) p <- PlotMultiDrugSurface( data, plot_block = 1, plot_value = "response", show_data_points = TRUE, distance_method = "mahalanobis", summary_statistic = "mean" ) p
This function will generate a scatter plot for all the combinations in the input data. The x-axis is the Combination Sensitive score (CSS).
PlotSensitivitySynergy( data, plot_synergy, point_size = 1, point_color = "#2D72AD", show_labels = FALSE, point_label_color = "#2D72AD", label_size = 10, dynamic = FALSE, plot_title = NULL, axis_line = FALSE, text_size_scale = 1 )
PlotSensitivitySynergy( data, plot_synergy, point_size = 1, point_color = "#2D72AD", show_labels = FALSE, point_label_color = "#2D72AD", label_size = 10, dynamic = FALSE, plot_title = NULL, axis_line = FALSE, text_size_scale = 1 )
data |
A list object has been processed by functions:
|
plot_synergy |
A character value. It indicates the synergy score for visualization. The available values are: "ZIP", "HSA", Bliss", "Leowe". |
point_size |
A numeric value. It indicates the size of points. The unit is "mm" |
point_color |
An R color value. It indicates the color for the points. |
show_labels |
A logic value. It indicates whether to show the labels along with points or not. |
point_label_color |
An R color value. It indicates the color for the label of data points. |
label_size |
A numeric value. It controls the size of the labels in "pt" |
dynamic |
A logical value. If it is |
plot_title |
A character value. It specifies the plot title. If it is
|
axis_line |
A logical value. Whether to show the axis lines and ticks. |
text_size_scale |
A numeric value. It is used to control the size of text for axis in the plot. All the text size will multiply by this scale factor. |
A ggplot object, while dynamic = FALSE
. A plotly object,
while dynamic = TRUE
.
Shuyu Zheng [email protected]
Jing Tang [email protected]
data("mathews_screening_data") data <- ReshapeData(mathews_screening_data) data <- CalculateSynergy(data, method = c("ZIP")) data <- CalculateSensitivity(data) PlotSensitivitySynergy(data, plot_synergy = "ZIP")
data("mathews_screening_data") data <- ReshapeData(mathews_screening_data) data <- CalculateSynergy(data, method = c("ZIP")) data <- CalculateSensitivity(data) PlotSensitivitySynergy(data, plot_synergy = "ZIP")
A function to visualize the synergy scores for drug combinations as 2D or 3D interaction landscape over the dose-response matrix.
PlotSynergy( data, type = "2D", method = "ZIP", block_ids = c(1), drugs = c(1, 2), row_range = NULL, col_range = NULL, color_range = NULL, z_range = NULL, axis_line = FALSE, statistic = NULL, summary_statistic = "mean", plot_title = NULL, interpolate_len = 3, high_value_color = "#FF0000", low_value_color = "#00FF00", text_size_scale = 1, heatmap_text_label_size_scale = 1, heatmap_text_label_color = "#000000", grid = TRUE, dynamic = FALSE, display = TRUE, save_file = FALSE, file_type = "pdf", file_name = NULL, file_path = NULL, height = 6, width = 6, units = "in" )
PlotSynergy( data, type = "2D", method = "ZIP", block_ids = c(1), drugs = c(1, 2), row_range = NULL, col_range = NULL, color_range = NULL, z_range = NULL, axis_line = FALSE, statistic = NULL, summary_statistic = "mean", plot_title = NULL, interpolate_len = 3, high_value_color = "#FF0000", low_value_color = "#00FF00", text_size_scale = 1, heatmap_text_label_size_scale = 1, heatmap_text_label_color = "#000000", grid = TRUE, dynamic = FALSE, display = TRUE, save_file = FALSE, file_type = "pdf", file_name = NULL, file_path = NULL, height = 6, width = 6, units = "in" )
data |
A list object generated by function
|
type |
A character value. It specifies the type of the plot. Available values are:
|
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, |
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. |
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 |
z_range |
A vector of two numeric values. They specify the range of
z-axis plotted in 3D surface plot. It doesn't work for 2D or heatmap plots.
Default value is |
axis_line |
A logical value. Whether to show the axis lines and ticks. It doesn't work for heatmap plot. |
statistic |
A character or NULL. It indicates the statistics printed in the plot while there are replicates in input data. Available values are:
If it is |
summary_statistic |
A vector of characters or NULL. It indicates the
summary statistics for all the
If it is |
plot_title |
A character value. It specifies the plot title. If it is
|
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
|
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 |
grid |
A logical value. It indicates whether to add grids on the pot.
It only works while |
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 |
file_type |
A character value. It indicates the device to use for saving
plots. If |
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 |
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 |
height |
A numeric value. It indicates the height of the output plot.
Note: It only works while |
width |
A numeric value. It indicates the width of the output plot.
Note: It only works while |
units |
A character value. It indicates the units for |
A list of ggplot objects.
Shuyu Zheng [email protected]
Jing Tang [email protected]
data("mathews_screening_data") data <- ReshapeData(mathews_screening_data) data <- CalculateSynergy(data) plots <- PlotSynergy(data, "2D", block_ids = NULL)
data("mathews_screening_data") data <- ReshapeData(mathews_screening_data) data <- CalculateSynergy(data) plots <- PlotSynergy(data, "2D", block_ids = NULL)
PredictResponse
uses drm
function to fit the dose
response model and generate the predict response value at the given dose.
PredictResponse(df, dose)
PredictResponse(df, dose)
df |
A data frame. It contains two variable:
|
dose |
A numeric vector. It specifies the dose at which user want to predict the response of cell line to the drug. |
Note: Random number generator used in AddNoise
with
method = "random"
. If the analysis requires for reproductiblity,
plesase set the random seed before calling this function.
A numeric vector. It is the response values of cell line to the drug at inputted dose.
Shuyu Zheng [email protected]
Jing Tang [email protected]
A function to transform the response data from data frame format to dose-response matrices. Several processes could be chose to add noise, impute missing values or correct base line to the dose-response matrix.
ReshapeData( data, impute = TRUE, impute_method = NULL, noise = FALSE, seed = NULL, iteration = 10, data_type = "viability" )
ReshapeData( data, impute = TRUE, impute_method = NULL, noise = FALSE, seed = NULL, iteration = 10, data_type = "viability" )
data |
drug combination response data in a data frame format |
impute |
a logical value. If it is |
impute_method |
a single string. It sets the |
noise |
a logical value. It indicates whether or not adding noise to
to the "response" values in the matrix. Default is |
seed |
a single value, interpreted as an integer, or NULL. It is the
random seed for calculating the noise and missing value imputation.
Default setting is |
iteration |
An integer. It indicates the number of iterations for bootstrapping while calculating statistics for data with replicates. |
data_type |
a parameter to specify the response data type which can be either "viability" or "inhibition". |
The input data must contain the following columns: (block_id/BlockId/PairIndex), (drug_row/DrugRow/Drug1), (drug_col/DrugCol/Drug2), (response/Response/inhibition/Inhibition), (conc_r/ConcRow/Conc1), (conc_c/ConcCol/Conc2), and (ConcUnit/conc_r_unit, conc_c_unit/ConcUnit1, ConcUnit2, ConcUnit3)
a list of the following components:
drug_pairs A data frame contains the name of all the tested drugs, concentration unit, block IDs and a logical column "replicate" to indicate whether there are replicates in the corresponding block.
response A data frame contains the columns: "concX" concentrations for drugs from input data; "response_origin" response values from input data; "response" % inhibition value for downstream analysis.
response_statistics A data frame. It will be output if there is block have replicated response values. It contains the block ID, the concentrations for all the tested drugs, and statistics for % inhibition values across replicates (including mean, standard deviation, standard error of mean and 95% confidence interval).
Shuyu Zheng [email protected]
Jing Tang [email protected]
data("mathews_screening_data") # set a random number seed for generating the noises data <- ReshapeData(mathews_screening_data, seed = 1)
data("mathews_screening_data") # set a random number seed for generating the noises data <- ReshapeData(mathews_screening_data, seed = 1)
ZIP
calculates the Delta score matrix from a dose-response
matrix by using Zero Interaction Potency (ZIP) method.
ZIP(response, Emin = NA, Emax = NA, quiet = TRUE)
ZIP(response, Emin = NA, Emax = NA, quiet = TRUE)
response |
A data frame. It must contain the columns: "conc1", "conc2", ..., for the concentration of the combined drugs and "response" for the observed %inhibition at certain combination. |
Emin |
The expected minimum response value in the 4 parameter log-logistic model. |
Emax |
The expected maximum response value in the 4 parameter log-logistic model. |
quiet |
A logical value. If it is |
Zero Interaction Potency (ZIP) is a reference model for evaluating
the conbimation effect of two drugs. It captures the effect of drug
combination by comparing the change in the potency of the dose-response
curves between individual drugs and their combinations.
The optional arguments drug.col.model
, drug.row.model
are
designed for reuse the single drug dose response model fitting results, if
it has been down before. Functions FitDoseResponse
and
ExtractSingleDrug
could be used to calculate these arguments.
A data frame containing the concentrations for drugs, reference effect, fitted response and synergy score estimated by ZIP model.
Shuyu Zheng [email protected]
Jing Tang [email protected]
Yadav B, Wennerberg K, Aittokallio T, Tang J. (2015). Searching for Drug Synergy in Complex Dose-Response Landscape Using an Interaction Potency Model. Comput Struct Biotechnol J, 13:504– 513.
# No single drug fitted modle before data("mathews_screening_data") data <- ReshapeData(mathews_screening_data) response <- data$response[data$response$block_id == 1, c("conc1", "conc2", "response")] ZIP_score <- ZIP(response) ## Not run: # Parallel processing: if (future::supportsMulticore()) { future::plan(future::multicore) } else { future::plan(future::multisession) } ZIP(response) # future::plan(future::sequential) # Turn off the multicore setting ## End(Not run)
# No single drug fitted modle before data("mathews_screening_data") data <- ReshapeData(mathews_screening_data) response <- data$response[data$response$block_id == 1, c("conc1", "conc2", "response")] ZIP_score <- ZIP(response) ## Not run: # Parallel processing: if (future::supportsMulticore()) { future::plan(future::multicore) } else { future::plan(future::multisession) } ZIP(response) # future::plan(future::sequential) # Turn off the multicore setting ## End(Not run)