Learn R Programming

hierGWAS (version 1.2.0)

test.hierarchy: Hierarchical Testing of SNPs

Description

Performs hierarchical testing of SNPs.

Usage

test.hierarchy(x, y, dendr, res.multisplit, covar = NULL, SNP_index = NULL, alpha = 0.05, global.test = TRUE, verbose = TRUE)

Arguments

x
The input matrix, of dimension nobs x nvar. Each row represents a subject, each column a SNP.
y
The response vector. It can be continuous or discrete.
dendr
The cluster tree obtained by hierchically clustering the SNPs using cluster.snp.
res.multisplit
The output of multisplit.
covar
NULL or the matrix of covariates one wishes to control for, of size nobs x ncovar.
SNP_index
NULL or the index vector of SNP to be tested. See the 'Details' section.
alpha
The significance level at which the FWER is controlled. Default value is 0.05.
global.test
Specifies wether the global null hypothesis should be tested. Default value is TRUE. See the 'Details' section.
verbose
Report information on progress. Default value is TRUE

Value

A list of significant SNP groups with the following components:
SNP_index
The indeces of the SNPs in the group
pval
The p-value of the SNP group

Details

The testing is performed on the cluster tree given by dendr. If the SNP data matrix was divided (e.g. by chromosome), and clustered separately, the user must provide the argument SNP_index, to specify which part of the data is being tested.

Testing starts at the highest level, which includes all variables specified by SNP_index, and moves down the cluster tree. It stops when a cluster's null hypothesis cannot be rejected anymore. The smallest, still significant clusters will be returned.

By default the parameter global.test = TRUE, which means that first the global null hypothesis is tested. If the data is divided (e.g. by chromosome), and clustered separately, this parameter can be set to FALSE once the global null has been rejected. This helps save time.

References

Buzdugan, L. et al. (2015), Assessing statistical significance in predictive genome-wide association studies

Examples

Run this code
library(MASS)
x <- mvrnorm(60,mu = rep(0,60), Sigma = diag(60))
beta <- rep(0,60)
beta[c(5,9,3)] <- 1
y <- x %*% beta + rnorm(60)
dendr <- cluster.snp(x = x, method = "average")
res.multisplit <- multisplit(x, y)
sign.clusters <- test.hierarchy(x, y, dendr, res.multisplit)

Run the code above in your browser using DataLab