Skip to contents

This function provides a simple wrapper to perform jackknife resampling on all columns of a SummarizedExperiment object and returns the results of each resample in a list. This function is designed to be used to assess the robustness of p-value combination techniques of the included meta_de() function but in theory any arbitrary function which operates on the columns of a SummarizedExperiment object could be used.

Usage

jackknifeSE(x, FUN, ...)

Arguments

x

SummarizedExperiment object to perform jackknife resampling of columns on

FUN

Function to perform on each resample.

...

Additional arguments passed to FUN

Value

List of jackknife resampled results

Examples

# Define three differential expression dataset data.frames
exp1 <- data.frame(
  feature_id = c("geneA", "geneB", "geneC"),
  PValue = c(0.01, 0.5, 0.05),
  FDR = c(0.02, 0.5, 0.07),
  logFC = c(1.2, -2.5, 3.7),
  logCPM = c(12, 9, 0)
)

exp2 <- data.frame(
  feature_id = c("geneA", "geneB", "geneD"),
  PValue = c(0.07, 0.3, 0.8),
  FDR = c(0.08, 0.4, 1.0),
  logFC = c(1.5, -2.0, 3.0),
  logCPM = c(14, 10, 2)
)

exp3 <- data.frame(
  feature_id = c("geneA", "geneB", "geneC", "geneD"),
  PValue = c(0.03, 0.3, 0.01, 0.8),
  FDR = c(0.08, 0.4, 0.04, 0.9),
  logFC = c(1.5, -2.0, 3.0, 4.1),
  logCPM = c(14, 10, 1, 2.1)
)

# Combine into a single list
l <- list(experiment1 = exp1, experiment2 = exp2, experiment3 = exp3)

# Convert the data to a SummarizedExperiment
se <- dfs2se(l)

# Perform the jackknife using meta_de on each subset of the data
result <- jackknifeSE(se, \(x) meta_de(x, metapod::parallelWilkinson, min.prop = 0.5))
#> Error in meta_de(x, metapod::parallelWilkinson, min.prop = 0.5): metapod package is required.

# Combine the results from calling meta_de on each resample and show
result <- data.table::rbindlist(result, idcol = "Jackknife")
#> Error in eval(expr, envir, enclos): object 'result' not found
head(result[order(Feature)])
#> Error in eval(expr, envir, enclos): object 'result' not found