combine_pvalues: Combine p-values of a feature over multiple p-value columns...

View source: R/combine_pvalues.R

combine_pvaluesR Documentation

Combine p-values of a feature over multiple p-value columns of an object

Description

Combine p-values of a feature over multiple p-value columns of an object. If alternative!="two.sided", uses the direction of stat.cols to transform p.cols into one-sided p-values; this assumes that these p-values were originally calculated from two-sided tests, as is done in limma.

Usage

combine_pvalues(
  tab,
  p.cols = "p|PValue",
  stat.cols = "logFC|slope|cor|rho|Direction",
  only.p = TRUE,
  alternative = c("two.sided", "greater", "less", "Up", "Down")
)

Arguments

tab

Matrix-like object with statistical columns, some containing p-values.

p.cols

Indices or regexp with column names or column names suffix of numeric p-value columns.

stat.cols

Indices or regexp with column names or column names suffix with numeric signed statistics, or with "Up", "Down" values.

only.p

Logical; should only combined p-values be returned? If not, returns matrix with z-scores and FDRs also.

alternative

Direction of change: "two.sided"; "greater" or "less", or their synonyms "Up" or "Down".

Details

Z-transform method is used to combine p-values across rows, similarly to using unweighted method="z.transform" in survcomp::combine.test, except this function slightly adjusts p-values of zero or one to avoid generating z-scores of infinite magnitude.

stat.cols are ignored if alternative is "two.sided". Otherwise, they should match p.cols.

Value

Vector of p-values.

Examples

 tab <- data.frame(foo.p=(1:9)/9, bar.p=(9:1)/9)
 combine_pvalues(tab)

jdreyf/ezlimma documentation built on March 3, 2024, 4:23 a.m.