Skip to contents

Aggregate predicted leave-one-out probabilities over meta variables over a list of SingleCellExperiment objects

Usage

calculateStats(sce, target, group, assay_type = "tfmfeatures")

Arguments

sce

A SingleCellExperiment object

target

Name of target variable for prediction

group

Grouping variable for cross-validation, e.g., patient

assay_type

A string specifying the assay

Value

data.frame

Examples

set.seed(23)
cell_file <- generate_data()
sce <- loadData(cell_file)
sce <- transformScale(sce)

sce$Drug <- as.factor(sce$Drug)
sce$Drug <- relevel(sce$Drug, ref = "D1")
types <- c("AreaShape", "Intensity", "Texture")

sce_single <- predictLOO(
    sce,
    target = "Drug", group = "Patient",
    interest_level = "D7", reference_level = "D1",
    types = types,
    n_threads = 1
)

calculateStats(sce_single, target = "Drug", group = "Patient")
#>   Target   Feature       pvalue log2FoldChange
#> 1     D7       all 3.051405e-05     0.93041835
#> 2     D7 AreaShape 9.141136e-01    -0.05218685
#> 3     D7 Intensity 6.024086e-01    -0.01291385
#> 4     D7   Texture 5.444865e-06     1.45407136