data.table::setDTthreads(1)
## 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)
Run the code above in your browser using DataLab