flipScoresTest: FlipScores test for RNA-Seq Data

View source: R/FlipScoresTest.R

flipScoresTestR Documentation

FlipScores test for RNA-Seq Data

Description

Computes p-values using a classic permutation test based on the absolute difference in means for the null hypothesis H_0: β_j = 0.

Usage

flipScoresTest(
  dge,
  design,
  scoreType = c("basic", "effective"),
  toBeTested = 2,
  nPerm = 5000
)

Arguments

dge

A dgeList object, created with edgeR, containing the normalization factors as computed by edgeR.

design

A model matrix; The first column should be all 1s. The second column should have two unique values, corresponding to the groups

scoreType

Type of Score contributions on which flipping is performed

toBeTested

index of column of design matrix which is tested

nPerm

Number of random permutations used for the computation of the p-value

Author(s)

Jakob Walter

References

Hemerik, Jesse, Jelle J. Goeman, and Livio Finos. "Robust testing in generalized linear models by sign flipping score contributions." Journal of the Royal Statistical Society: Series B (Statistical Methodology) 82.3 (2020): 841-864.

Examples

Y <- rnbinom(20*10, mu = 10, size = 1/0.2)
Y <- data.frame(array(Y, dim = c(20, 10)))
X1 <- as.factor(rep(c("A", "B"), each = 20/2))
design <- model.matrix(~X1, contrasts.arg = list(X1 = "contr.sum"))
dge <- edgeR::DGEList(counts = t(Y), group = X1)
dge <- edgeR::calcNormFactors(dge)
flipScoresTest(dge, design, scoreType = c("basic"), nPerm = 100)

jakobwalter/RNAPerm documentation built on Sept. 17, 2022, 3:57 p.m.