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.42   NA    NA    5783042           NA               0.127
#> ITFG2          3.99   NA    NA        110        0.709               0.367
#>       Chlorambucil Etoposide Cytarabine                 Azd-5991 5-azacytidine
#> FSHR          6.62      4.42         NA 76479449657720373248.000        0.0696
#> ITFG2        26.10     23.80         NA                    0.926        0.0488
#>       Mik665 Luminespib Camptothecin Anastrozole Sb590885 Fluvastatin_sodium
#> FSHR    46.1     0.0821         3.13        62.3    0.157               1.66
#> ITFG2    1.5     4.4900       237.00       110.0    1.170              14.40
#>       Ceralasertib Capivasertib Erlotinib_hydrochloride Nutlin-3a
#> FSHR         1.260      0.00672                   0.267     0.333
#> ITFG2        0.378           NA                   0.307     0.570
#>       Mk-2206_dihydrochloride Ribociclib Adavosertib Trametinib Temsirolimus
#> FSHR                    3.030     0.0658       0.212     0.0173         9.75
#> ITFG2                   0.542     0.5070       1.040     1.1000        18.70
#>       Abemaciclib Ponatinib Fludarabine
#> FSHR         1.89      3.03   140255.00
#> ITFG2        0.63      2.73        1.92