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 from either our MRCIEU r-universe or from the GitHub repository with, either:

install.packages('ieugwasr', repos = c('https://mrcieu.r-universe.dev', 'https://cloud.r-project.org'))

or,

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,205

Version

1.0.4

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Gibran Hemani

Last Published

June 18th, 2025

Functions in ieugwasr (1.0.4)

ieugwasr-package

ieugwasr: Interface to the 'OpenGWAS' Database API
associations

Query specific variants from specific GWAS
check_reset

Check if OpenGWAS allowance needs to be reset
variants_to_rsid

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

Perform LD clumping on SNP data
fill_n

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

Get LD matrix using local plink binary and reference dataset
gwasinfo

Get list of studies with available GWAS summary statistics through API
print.GwasInfo

Print GWAS information
variants_rsid

Obtain information about rsid
variants_gene

Obtain variants around a gene
infer_ancestry

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

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

Toggle API address between development and release
ld_clump_api

Perform clumping on the chosen variants using through API
print.ApiStatus

Print API status
phewas

Perform fast phewas of a specific variants against all available GWAS datasets
user

Get user details
variants_chrpos

Obtain information about chr pos and surrounding region
legacy_ids

Convert current IDs to legacy IDs
logging_info

Details of how access token logs are used
gwasinfo_files

Get list of download URLs for each file associated with a dataset through API
set_reset

Set the reset time for OpenGWAS allowance
tophits

Obtain top hits from a GWAS dataset
check_access_token

Check if authentication has been made
afl2_chrpos

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

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

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

Wrapper for sending queries and payloads to API
api_status

OpenGWAS server status
batches

Get list of data batches in IEU OpenGWAS database
batch_from_id

Extract batch name from study ID
editcheck

Check datasets that are in process of being uploaded
ld_matrix

Get LD matrix for list of SNPs
ld_clump_local

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

Retrieve OpenGWAS JSON Web Token from .Renviron file
get_query_content

Parse out json response from httr object