test.hierarchy: Hierarchical Testing of SNPs

Description Usage Arguments Details Value References Examples

View source: R/test.hierarchy.R

Description

Performs hierarchical testing of SNPs.

Usage

1
2
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

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.

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

References

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

Examples

1
2
3
4
5
6
7
8
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)

Example output

Testing the global null hypothesis..
The global null hypothesis was rejected
Testing the hierarchy
Tested a group with 60 SNPs.
The group is significant.
Testing the children of the group:
Child 1 with 26 SNPs and child 2 with 34
Tested a group with 34 SNPs.
The group is significant.
Testing the children of the group:
Child 1 with 9 SNPs and child 2 with 25
Tested a group with 9 SNPs.
The group is significant.
Testing the children of the group:
Child 1 with 3 SNPs and child 2 with 6
Tested a group with 25 SNPs.
The group is significant.
Testing the children of the group:
Child 1 with 13 SNPs and child 2 with 12
Tested a group with 6 SNPs.
The group is significant.
Testing the children of the group:
Child 1 with 4 SNPs and child 2 with 2
Tested a group with 13 SNPs.
The group is significant.
Testing the children of the group:
Child 1 with 4 SNPs and child 2 with 9
Tested a group with 2 SNPs.
The group is significant.
Testing the children of the group:
Child 1 with 1 SNPs and child 2 with 1
Tested a group with 4 SNPs.
The group is significant.
Testing the children of the group:
Child 1 with 2 SNPs and child 2 with 2
Tested a group with 2 SNPs.
The group is significant.
Testing the children of the group:
Child 1 with 1 SNPs and child 2 with 1

hierGWAS documentation built on Nov. 8, 2020, 8:05 p.m.