AFb: Adaptive Fisher Method with B-spline basis funcitons (AFb)...

Description Usage Arguments Value See Also Examples

View source: R/AFb.R

Description

Adaptive Fisher Method with B-spline basis funcitons (AFb) for Trait-Methylation Set Association

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
AFb(
  Y,
  M,
  pos,
  nbasis,
  start = NULL,
  end = NULL,
  binary = FALSE,
  cov = NULL,
  nperm = 1000,
  adapt_perm = FALSE,
  cutoff = 2.5e-06,
  seed = NULL,
  n0 = 1,
  ...
)

Arguments

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).

pos

A vector of CpG locations (in base pairs). Elements should be of the same order as the columns of M.

nbasis

The number of B-spline basis functions.

start

Start location of the region.

end

End location of the region.

binary

Indicator of whether Y is binary.

cov

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

nperm

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

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.

n0

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

...

Optional arguments for create.bspline.basis.

Value

An object of "AFb" class.

pv

P-value of AFb test.

stat

Test statistic of AFb test.

indexes

Indexes of basis functions 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.

See Also

create.bspline.basis, set.seed

Examples

1
2
3
4
5
Y <- bs_dense$trait
methyl <- bs_dense$methyl
pos <- bs_dense$pos
test <- AFb(Y, methyl, pos, nbasis = 10,
            binary = TRUE, adapt_perm = TRUE)

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

Related to AFb in cxystat/AFb...