AFv: Adaptive Fisher Method for Testing Methylation Variation

Description Usage Arguments Value See Also Examples

View source: R/AFv.R

Description

Adaptive Fisher Method for Testing Methylation Variation

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
AFv(
  Y,
  M,
  pos,
  nbasis,
  start = NULL,
  end = NULL,
  binary = FALSE,
  cov = NULL,
  nperm = 1000,
  bandwidth = 5509,
  kernel = c("normal", "box"),
  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.

bandwidth

bandwidth The bandwidth for ksmooth. Default is 5509, 20 % of the median gene length according to UCSC Genome build hg38.

kernel

kernel The kernel to be used for ksmooth

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 create.bspline.basis.

Value

An object of "AFv" class.

pv

P-value of AFv test.

stat

Test statistic of AFv test.

indexes

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

stat_all

AFv statistics for all permuted samples.

pv_all

P-values of AFv statistics for all permuted samples.

method

Method used.

See Also

create.bspline.basis, set.seed, ksmooth

Examples

1
2
3
4
5
6
Y <- bs_dense$trait
methyl <- bs_dense$methyl
pos <- bs_dense$pos
test <- AFv(Y, methyl, pos, nbasis =10, bandwidth = 500,
            kernel = "box", binary = TRUE)
summary(test)

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

Related to AFv in cxystat/AFb...