Description Usage Arguments Value References Examples

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.

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

`hsumstats` |
A data frame processed by |

`x` |
A |

`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". |

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

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).

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ```
## 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)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.