wAF_combine: wAF Combination

Description Usage Arguments Value Examples

View source: R/combine.R

Description

This function combines P-values using weighted adaptive Fisher (wAF) method.

Usage

1
wAF_combine(p, log = FALSE, weight = NULL, n0 = 1)

Arguments

p

P-values to be combined. A matrix with dimenstions K by N. If an object of P-values from perm_score is used, K is the number of SNVs, and N is the number of permutations plus 1.

log

Indicator of whether P-values are on the log scale.

weight

Weights given to the P-values. A vector with dimension K. Flat weight is used if it is not specified.

n0

Tuning parameter. Discard the first n0-1 P-values of each column.

Value

A list object.

pv

P-value of wAF test.

stat

wAF test (for observed data, i.e. first column of matrix p).

loci_combined

Variants which are combined into the test statistic. The index of included variants are returned in the ascending order of their weighted P-values.

stat_all

wAF statistics for all permuted samples.

pv_all

P-values of wAF statistics for all permuted samples.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Combine P-values of normally distributed test statistics
U <- matrix(rnorm(10 * 100), ncol=100)
p <- 2 * (1 - pnorm(abs(U)))
wt <- (1:10)/55
test <- wAF_combine(p, weight = wt)

# Combine P-values from perm_score
Y <- SNV_sparse$trait
X <- SNV_sparse$SNV[, -SNV_sparse$zero_var]
result <- perm_score(Y, X, nperm = 100)
test <- wAF_combine(result$pvs)

songbiostat/wAF documentation built on Feb. 26, 2021, 6:24 p.m.