Skip to contents

This function fits dose-response models for a set of genes across different treatments using the drc package. It returns EC50 values per gene per treatment.

Usage

compute_multiple_dose_response(
  data,
  genes = NULL,
  normalisation = "limma_voom",
  control_value = "DMSO",
  batch = 1,
  k = 2,
  num_cores = 1
)

Arguments

data

A Seurat or TidySeurat object containing expression data and metadata.

genes

A character vector of gene names to model. If NULL, all significant DE genes across comparisons are used.

normalisation

A character string indicating the normalization method. One of: "raw", "logNorm", "cpm", "clr", "SCT", "DESeq2", "edgeR", "RUVg", "RUVs", "RUVr", "limma_voom", "zinb". Default is "limma_voom".

control_value

A string indicating the control condition in "Treatment_1". Default is "DMSO".

batch

Batch variable to use for normalization if applicable. Default is 1.

k

Number of unwanted factors for RUV normalization. Default is 2.

num_cores

Number of CPU cores to use in parallel model fitting. Default is 1.

Value

A data frame of EC50 values per gene and treatment.

Examples

data(mini_mac)
res <- compute_multiple_dose_response(
  data = mini_mac,
  genes = c("FSHR", "ITFG2"),
  normalisation = "limma_voom",
  control_value = "DMSO",
  num_cores = 1
)
#> tidyseurat says: Key columns are missing. A data frame is returned for independent data analysis.
#> StaurosporineDMSOControl measurements detected for level: 1
#> Control measurements detected for level: 1
#> MediaControl measurements detected for level: 1
#> Control measurements detected for level: 1
#> PaclitaxelThapsigarginError in optim(startVec, opfct, hessian = TRUE, method = optMethod, control = list(maxit = maxIt,  : 
#>   non-finite finite-difference value [4]
#> Vinblastine_sulfateChlorambucilEtoposideCytarabineError in optim(startVec, opfct, hessian = TRUE, method = optMethod, control = list(maxit = maxIt,  : 
#>   non-finite finite-difference value [4]
#> Error in optim(startVec, opfct, hessian = TRUE, method = optMethod, control = list(maxit = maxIt,  : 
#>   non-finite finite-difference value [1]
#> Azd-59915-azacytidineMik665LuminespibCamptothecinAnastrozoleSb590885Fluvastatin_sodiumCeralasertibCapivasertibError in optim(startVec, opfct, hessian = TRUE, method = optMethod, control = list(maxit = maxIt,  : 
#>   non-finite finite-difference value [4]
#> Erlotinib_hydrochlorideNutlin-3aMk-2206_dihydrochlorideRibociclibAdavosertibTrametinibTemsirolimusAbemaciclibPonatinibFludarabine
head(res)
#>       Staurosporine DMSO Media Paclitaxel Thapsigargin Vinblastine_sulfate
#> FSHR         4.4164   NA    NA 5783042.00           NA             0.12721
#> ITFG2        3.9857   NA    NA     109.89      0.70869             0.36661
#>       Chlorambucil Etoposide Cytarabine   Azd-5991 5-azacytidine  Mik665
#> FSHR        6.6185    4.4211         NA 7.6479e+19      0.069563 46.1340
#> ITFG2      26.1280   23.8280         NA 9.2609e-01      0.048804  1.4967
#>       Luminespib Camptothecin Anastrozole Sb590885 Fluvastatin_sodium
#> FSHR     0.08212       3.1342      62.325  0.15654             1.6629
#> ITFG2    4.49240     236.6200     110.150  1.17420            14.4120
#>       Ceralasertib Capivasertib Erlotinib_hydrochloride Nutlin-3a
#> FSHR       1.26270    0.0067156                 0.26679   0.33298
#> ITFG2      0.37764           NA                 0.30657   0.57002
#>       Mk-2206_dihydrochloride Ribociclib Adavosertib Trametinib Temsirolimus
#> FSHR                  3.02950   0.065756     0.21233   0.017333       9.7503
#> ITFG2                 0.54178   0.506880     1.03570   1.102000      18.6660
#>       Abemaciclib Ponatinib Fludarabine
#> FSHR      1.89380    3.0276 140255.0000
#> ITFG2     0.63033    2.7319      1.9245