AFpca: Adaptive Fisher Method with Principal Components (AFpca) for...

Description Usage Arguments Value Examples

View source: R/AFpca.R

Description

Adaptive Fisher Method with Principal Components (AFpca) for Trait-Methylation Set Association

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
AFpca(
  Y,
  M,
  binary = FALSE,
  cov = NULL,
  varprop = 0.95,
  nperm = 1000,
  n0 = 1,
  adapt_perm = FALSE,
  cutoff = 2.5e-06,
  seed = NULL
)

Arguments

Y

Y Phenotype data. It can be a continuous trait or a binary trait. A vector of length n (number of subjects).

M

A matrix of methylation levels with dimensions n by K (n subjects, K CpG sites).

binary

Indicator of whether Y is binary.

cov

Covariates. A matrix with dimensions n by J (number of covariates).

varprop

Cutoff for proportion of variance to be expalined. The first Kp principal components (PCs) are chosen such that varprop of the total variance is explained.

nperm

Number of permutations. Also the starting number of permutations for "step-up" algorithm. Default is 1,000.

n0

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

adapt_perm

Whether "step-up" algorithm is used for P-value calculation. If FALSE, function permutes nperm times and stops. If TRUE, nperm will be increased 10 times each round if P-value <= 5/nperm. Algorithm stops if P-value > 5/nperm or <= cutoff.

cutoff

Cutoff for "step-up" algorithm.

seed

Specify the seed for permutations.

Value

An object of "AFpca" class.

pv

P-value of AFb test.

stat

Test statistic of AFb test.

indexes

Indexes of PCs combined into the test statistic. Indexes are sorted so that P-values are in ascending order.

stat_all

AFb statistics for all permuted samples.

pv_all

P-values of AFb statistics for all permuted samples.

method

Method used.

Examples

1
2
3
4
5
6
Y <- bs_dense$trait
methyl <- bs_dense$methyl
pos <- bs_dense$pos
test <- AFpca(Y, methyl, varprop = 0.9,
            binary = TRUE, adapt_perm = TRUE)
summary(test)

cxystat/AFb documentation built on June 17, 2021, 7:30 p.m.