knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(TidyComb) library(reshape2) library(dplyr)
The Relative Inhibition (RI) score is the proportion of the area under the log10-scaled dose-response curve, to the maximum area or the maximum possible inhibition that one drug can achieve at the same dose range. $$ AUC = \int_{c_1}^{c_2} y_{min} + \frac{y_{max} - y_{min}}{1 + 10 ^ {\lambda(log_{10}{IC_{50} - x'}dx')}} \ RI = 100 \times \frac{AUC-inh_{min}(c_2 - c_1)}{(1-inh_{min}){c_2 - c_1}} $$
, where $x' = log_{10}x$; $[c_1,c_2]$ is the concentration range in which the drug was tested; $inh_{min}$ is the minimum inhibition rate the drug can achieve at the dose range [c~1~, c~2~]. (0 is set by default in function)
Input data should be a data frame which contains two columns:
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)) sens <- CalculateSens(df) print(sens)
Calculate 95% confidence interval of RI by simulation. The iteration is set as 100 times by default
pred <- CalculateSens(df, pred = TRUE)$pred RIConfidenceInterval(pred)
The input data is a matrix which contains the drug combination reaponse value. Its column names are doses of drug added along columns. Its row name are doses of drug added along rows.
Note: the matrix should be sorted by:
data <- read.csv(system.file("template.csv", package = "TidyComb"), stringsAsFactors = FALSE) response.mat <- reshape2::acast(conc_r~conc_c, value.var = "inhibition", data = data[data$block_id == 1, ]) response.mat
The CalculateMat
function with summary.only = TRUE
setting will return a data frame which contains:
CalculateMat(response.mat, summary.only = TRUE)
By setting summary.only = FALSE
, you can get 3 more tables:
synergy: percentage inhibitions and synergy scores for each wells in the matrix
surface: smoothed response or synergy surface for the combination
* curve: model used to fit two single drug dose response curves and fitted parameters.
res <- CalculateMat(response.mat) res
The input data must be a data frame which contains following columns:
data
CalculateTemplate(data, summary.only = TRUE)
Function ParCalculateTemplate
allows you to do the calculation parallelly on multiple cores.
res <- ParCalculateTemplate(data, cores = 4) res
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.