snpset_test: Set-based association tests

View source: R/snpset_test.R

snpset_testR Documentation

Set-based association tests

Description

Perform set-based association tests between multiple sets of SNPs and a phenotype using GWAS summary statistics. If the function encounters missing genotypes in the reference data, they will be imputed with genotype means.

Usage

snpset_test(hsumstats, x, snp_sets, method = c("saddle", "davies"))

Arguments

hsumstats

A data frame processed by harmonize_sumstats.

x

A bed.matrix object created from the reference data.

snp_sets

A named list where each index represents a separate set of SNPs.

method

A method to compute a set-level p value. "saddle" uses Kuonen's saddlepoint approximation (1999) and "davies" uses the algorithm of Davies (1980). When "davies" method failed to produce a meaningful result, "saddle" method is used as a fallback. Default is "saddle".

Value

A data.table with columns: "set.id", "pvalue", "n.snp", "top.snp.id" and "top.snp.pvalue"

  • set.id = a name of SNP set

  • tstat = a test statistic

  • pvalue = a set-level p value

  • n.snp = the number of SNPs used in a test

  • top.snp.id = SNP ID with the smallest p-value within a set of SNPs

  • top.snp.pvalue = The smallest p-value within a set of SNPs

References

Kuonen, D. Saddlepoint Approximations for Distributions of Quadratic Forms in Normal Variables. Biometrika 86, 929–935 (1999).

Davies, R. B. Algorithm AS 155: The Distribution of a Linear Combination of Chi-Square Random Variables. Journal of the Royal Statistical Society. Series C (Applied Statistics) 29, 323–333 (1980).

Examples


## GWAS summary statistics
head(exGWAS)

## Load reference genotype data
bfile <- system.file("extdata", "example.bed", package = "snpsettest")
x <- read_reference_bed(path = bfile)

## GWAS harmonization with reference data
hsumstats <- harmonize_sumstats(exGWAS, x)

## Perform a set-based test with an arbitrary SNP set
snpset_test(hsumstats, x, list(test = c("SNP_880", "SNP_1533", "SNP_4189")))

## Gene information data
head(gene.curated.GRCh37)

## Map SNPs to genes
snp_sets <- map_snp_to_gene(hsumstats, gene.curated.GRCh37)

## Perform gene-based association tests
out <- snpset_test(hsumstats, x, snp_sets$sets)


snpsettest documentation built on Sept. 10, 2023, 1:08 a.m.