View source: R/calculate_pipeline.R
CalculateMat | R Documentation |
CalculateMat
chains all calculations about one dose-response matrix (
one drug-drug interaction block) together. The calculations includes:
dose-response curve fitting, synergy scores (ZIP, Bliss, Loewe,
HSA, S), drug sensitivity (RI, CSS), generate drug-drug response surface and
generating summary scores for each block.
CalculateMat( response.mat, noise = TRUE, correction = "non", summary.only = FALSE, seed = NULL )
response.mat |
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. |
noise |
a logical value. It indicates whether or not adding noise to
to the "inhibition" values in the matrix. Default is |
correction |
a string. It indicates which method used by function
|
summary.only |
a logical value. If it is |
seed |
a integer or NULL. It is used to set the random seed to
|
The steps for calculation:
Pre-process Matrix
Impute for missing values (with the average of values from the
nearest four cells) in original matrix by using function
ImputeNA
.
Add noise(A small random number ranging from 0 to 0.001) to
original matrix by using function AddNoise
.
)
Correct baseline using function
CorrectBaseLine
with the method
selected by parameter correction
.
Single drug process
Extract and fitting single drugs.
Extract coeficients from fitted model. (b, c, d, e, IC50)
Calculate RI(Relative inhibition for single drug) with function
CalculateSens
Whole response matrix process
Calculate Synergy Scores with function
ZIP
,
Bliss
, HSA
,
Loewe
in synergyfinder
package.
Calculate Surface(The landscape of response, synergy scores)
Calculate CSS(drug combination sensitivity score), S(synergy score calculated from CSS and IR)
Summarize and generate surface
A list contains 4 tables:
response It contains the modified inhibition value and 4 type of synergy scores of each drug dose response pair.
summary It contains summarized information of each blocks: synergy scores, css, ri, S
curve It contains the coefficients from single drug dose response curve.
surface It contains the smoothed inhibition values and synergy scores for plotting the scores' landscape.
If summary.only
is TRUE
, it will return only the "summary"
data frame.
Jing Tang jing.tang@helsinki.fi Shuyu Zheng shuyu.zheng@helsinki.fi
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, ]) res <- CalculateMat(response.mat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.