bd.gwas.test {Ball} | R Documentation |
Fast K-sample Ball Divergence Test for GWAS Data
Description
Fast K-sample Ball Divergence Test for GWAS Data
Usage
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,
...
)
Arguments
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. |
Value
bd.gwas.test returns a list containing the following components:
statistic |
ball divergence statistics vector. |
permuted.statistic |
a data.frame containing permuted ball divergence statistic for pre-screening SNPs.
If |
eigenvalue |
the eigenvalue of spectrum decomposition. If |
p.value |
the p-values of ball divergence test. |
refined.snp |
the SNPs have been refined. |
refined.p.value |
the refined |
refined.permuted.statistic |
a data.frame containing permuted ball divergence statistics for refining |
screening.result |
a list containing the result of screening. |
Author(s)
Jin Zhu
References
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
See Also
Examples
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"]])