bd.gwas.test | R Documentation |
Fast K-sample Ball Divergence Test for GWAS Data
bd.gwas.test( x, snp, screening.method = c("permute", "spectrum"), refine = TRUE, num.permutations, distance = FALSE, alpha, screening.result = NULL, verbose = TRUE, seed = 1, num.threads = 0, ... )
x |
a numeric vector, matrix, data.frame, dist object. |
snp |
a numeric matrix recording the values of single nucleotide polymorphism (SNP). Each column must be an integer vector. |
screening.method |
if |
refine |
a logical value. If |
num.permutations |
the number of permutation replications. When |
distance |
if |
alpha |
the significance level. Default: |
screening.result |
A object return by |
verbose |
Show computation status and estimated runtimes. Default: |
seed |
the random seed. Default |
num.threads |
number of threads. If |
... |
further arguments to be passed to or from methods. |
bd.gwas.test returns a list containing the following components:
|
ball divergence statistics vector. |
|
a data.frame containing permuted ball divergence statistic for pre-screening SNPs.
If |
|
the eigenvalue of spectrum decomposition. If |
|
the p-values of ball divergence test. |
|
the SNPs have been refined. |
|
the refined p-value of significant snp. |
|
a data.frame containing permuted ball divergence statistics for refining p-values. |
|
a list containing the result of screening. |
Jin Zhu
Yue Hu, Haizhu Tan, Cai Li, and Heping Zhang. (2021). Identifying genetic risk variants associated with brain volumetric phenotypes via K-sample Ball Divergence method. Genetic Epidemiology, 1–11. https://doi.org/10.1002/gepi.22423
bd
, bd.test
library(Ball) set.seed(1234) num <- 200 snp_num <- 500 p <- 5 x <- matrix(rnorm(num * p), nrow = num) snp <- sapply(1:snp_num, function(i) { sample(0:2, size = num, replace = TRUE) }) snp1 <- sapply(1:snp_num, function(i) { sample(1:2, size = num, replace = TRUE) }) snp <- cbind(snp, snp1) res <- Ball::bd.gwas.test(x = x, snp = snp) mean(res[["p.value"]] < 0.05) mean(res[["p.value"]] < 0.005) ## only return the test statistics; res <- Ball::bd.gwas.test(x = x, snp = snp, num.permutation = 0) ## save pre-screening process results: x <- matrix(rnorm(num * p), nrow = num) snp <- sapply(1:snp_num, function(i) { sample(0:2, size = num, replace = TRUE, prob = c(1/2, 1/4, 1/4)) }) snp_screening <- Ball::bd.gwas.test(x = x, snp = snp, alpha = 5*10^-4, num.permutations = 19999) mean(res[["p.value"]] < 0.05) mean(res[["p.value"]] < 0.005) mean(res[["p.value"]] < 0.0005) ## refine p-value according to the pre-screening process result: res <- Ball::bd.gwas.test(x = x, snp = snp, alpha = 5*10^-4, num.permutations = 19999, screening.result = snp_screening[["screening.result"]])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.