Learn R Programming

Perform fast queries in R against a massive database of complete GWAS summary data

The OpenGWAS database comprises over 50,000 curated, QC'd and harmonised complete GWAS summary datasets and can be queried using an API. See here for documentation on the API itself. This R package is a wrapper to make generic calls to the API, plus convenience functions for specific queries.

Methods currently implemented:

  • Get meta data about specific or all studies
  • Obtain the top hits (with on the fly clumping as an option) from each of the GWAS datasets. Clumping and significance thresholds can be specified
  • Obtain the summary results of specific variants across specific studies. LD-proxy lookups are performed automatically if a specific variant is absent from a study
  • Query a genomic region in a GWAS dataset, e.g. for fine mapping or colocalisation analysis
  • Perform PheWAS

There are a few convenience functions also:

  • Query dbSNP data, allowing conversion between chromosome:position and rsids and getting annotations
  • Perform LD clumping using the server, or locally
  • Obtain LD matrices for a list of SNPs using the server or locally (e.g. for fine mapping, colocalisation or Mendelian randomization)

See https://github.com/MRCIEU/gwasglue2 for information about how to connect the genotype and LD data to other packages involving colocalisation, finemapping, visualisation and MR.

Installation

Install from CRAN using:

install.packages("ieugwasr")

or install the developer version of ieugwasr with:

remotes::install_github("mrcieu/ieugwasr")

Browse the vignettes etc for information on how to use this package: https://mrcieu.github.io/ieugwasr/

Copy Link

Version

Install

install.packages('ieugwasr')

Monthly Downloads

4,102

Version

1.0.3

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Gibran Hemani

Last Published

March 20th, 2025

Functions in ieugwasr (1.0.3)

editcheck

Check datasets that are in process of being uploaded
gwasinfo

Get list of studies with available GWAS summary statistics through API
infer_ancestry

Infer ancestry of GWAS dataset by matching against 1000 genomes allele frequencies
logging_info

Details of how access token logs are used
legacy_ids

Convert current IDs to legacy IDs
ld_clump_api

Perform clumping on the chosen variants using through API
fill_n

Look up sample sizes when meta data is missing from associations
set_reset

Set the reset time for OpenGWAS allowance
tophits

Obtain top hits from a GWAS dataset
variants_chrpos

Obtain information about chr pos and surrounding region
user

Get user details
gwasinfo_files

Get list of download URLs each file (.vcf.gz, .vcf.gz.tbi, _report.html) associated with the dataset. The URLs will expire in 2 hours. If a dataset is missing from the results, that means the dataset doesn't exist or you don't have access to it. If a dataset is in the results but some/all links are missing, that means the files are unavailable.
ld_clump_local

Wrapper for clump function using local plink binary and ld reference dataset
ld_matrix_local

Get LD matrix using local plink binary and reference dataset
ld_reflookup

Check which rsids are present in a remote LD reference panel
variants_gene

Obtain variants around a gene
get_query_content

Parse out json response from httr object
phewas

Perform fast phewas of a specific variants against all available GWAS datasets
print.ApiStatus

Print API status
ld_matrix

Get LD matrix for list of SNPs
print.GwasInfo

Print GWAS information
variants_to_rsid

Convert mixed array of rsid and chrpos to list of rsid
select_api

Toggle API address between development and release
variants_rsid

Obtain information about rsid
batch_from_id

Extract batch name from study ID
check_reset

Check if OpenGWAS allowance needs to be reset
afl2_list

Retrieve a allele frequency and LD scores for pre-defined lists of variants
api_status

MR-Base server status
api_query

Wrapper for sending queries and payloads to API
afl2_chrpos

Look up allele frequencies and LD scores for 1000 genomes populations by chrpos
check_access_token

Check if authentication has been maded
afl2_rsid

Look up allele frequencies and LD scores for 1000 genomes populations by rsid
associations

Query specific variants from specific GWAS
batches

Get list of data batches in IEU GWAS database
ieugwasr-package

ieugwasr: Interface to the 'OpenGWAS' Database API
ld_clump

Perform LD clumping on SNP data
get_opengwas_jwt

Retrieve OpenGWAS JSON Web Token from .Renviron file