CalculateMat: Chain all calculation about one dose-response matrix

View source: R/calculate_pipeline.R

CalculateMatR Documentation

Chain all calculation about one dose-response matrix

Description

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.

Usage

CalculateMat(
  response.mat,
  noise = TRUE,
  correction = "non",
  summary.only = FALSE,
  seed = NULL
)

Arguments

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.
Note: the matrix should be sorted by: 1. The concentrations along the column increase from left to right; 2. The concentrations along the row increase from top to bottom.

noise

a logical value. It indicates whether or not adding noise to to the "inhibition" values in the matrix. Default is TRUE.

correction

a string. It indicates which method used by function CorrectBaseLine for base line correction.

  • non: no baseline correction;

  • par: only correct base line on negative values in the matrix;

  • all: correct base line on all the values in the matrix.

summary.only

a logical value. If it is TRUE then only summary table is calculated and returned, otherwise, for tables will be return. Default setting is FALSE.

seed

a integer or NULL. It is used to set the random seed to AddNoise function to make sure the results are reproducible. By default, it is set as NULL which means no seed was set.

Details

The steps for calculation:

  1. Pre-process Matrix

    1. Impute for missing values (with the average of values from the nearest four cells) in original matrix by using function ImputeNA.

    2. Add noise(A small random number ranging from 0 to 0.001) to original matrix by using function AddNoise. )

    3. Correct baseline using function CorrectBaseLine with the method selected by parameter correction.

  2. Single drug process

    1. Extract and fitting single drugs.

    2. Extract coeficients from fitted model. (b, c, d, e, IC50)

    3. Calculate RI(Relative inhibition for single drug) with function CalculateSens

  3. Whole response matrix process

    1. Calculate Synergy Scores with function ZIP, Bliss, HSA, Loewe in synergyfinder package.

    2. Calculate Surface(The landscape of response, synergy scores)

    3. Calculate CSS(drug combination sensitivity score), S(synergy score calculated from CSS and IR)

  4. Summarize and generate surface

Value

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.

Author(s)

Jing Tang jing.tang@helsinki.fi Shuyu Zheng shuyu.zheng@helsinki.fi

Examples

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)

DrugComb/TidyComb documentation built on June 22, 2022, 2:49 a.m.