Skip to contents

This function performs p-value combination for all genes and estimates summary statistics for average effect sizes for all experiments in the input SummarizedExperiment object.

Usage

meta_de(x, FUN, pval = "PValue", lfc = "logFC", ...)

Arguments

x

SummarizedExperiment object containing combined differential expression results from different studies. The SE object must contain at least two assays, one for the P-values to combine and the other for the effect sizes to compute (e.g. logFC).

FUN

One of the 'parallel' functions provided by metapod. One of "parallelBerger", "parallelFisher", "parallelHolmMin", "parallelPearson", "parallelSimes", "parallelStouffer", or "parallelWilkinson".

pval

assay name in SE object containing the P-values to combine.

lfc

assay name in the SE object containing the logFC values to combine.

...

Additional arguments passed to FUN. See the metapod package for details.

Value

data.table with summary stats of the p-value combination of all experiments. Please see the documentation in the metapod package for more details. The returned columns, "Rep.LogFC" and "Rep.Pval" contain the results of extracting the representative effect and P=value from all influential tests. These are individual tests in the data that are particularly important for calculating the combined effects.

Examples

# Example taken from ?dfs2se()

# Define two 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)
)

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

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

# Perform p-value combination across experiments for each gene
#  using Wilkinson's method and passing additional values
result <- meta_de(se, metapod::parallelWilkinson, min.prop = 0.1)
#> Error in meta_de(se, metapod::parallelWilkinson, min.prop = 0.1): metapod package is required.
head(result)
#> Error in eval(expr, envir, enclos): object 'result' not found