Learn R Programming

gwasrapidd

The goal of {gwasrapidd} is to provide programmatic access to the NHGRI-EBI Catalog of published genome-wide association studies.

Get started by reading the documentation.

Installation

Install {gwasrapidd} from CRAN:

install.packages("gwasrapidd")

Cheatsheet

Example

Get studies related to triple-negative breast cancer:

library(gwasrapidd)
studies <- get_studies(efo_trait = 'triple-negative breast cancer')
studies@studies[1:4]
## # A tibble: 3 × 4
##   study_id     reported_trait         initial_sample_size replication_sample_s…¹
##   <chr>        <chr>                  <chr>               <chr>                 
## 1 GCST002305   Breast cancer (estrog… 1,529 European anc… 2,148 European ancest…
## 2 GCST010100   Breast cancer (estrog… 8,602 European anc… <NA>                  
## 3 GCST90029052 15-year breast cancer… 5,631 European anc… <NA>                  
## # ℹ abbreviated name: ¹​replication_sample_size

Find associated variants with study GCST002305:

variants <- get_variants(study_id = 'GCST002305')
variants@variants[c('variant_id', 'functional_class')]
## # A tibble: 5 × 2
##   variant_id functional_class   
##   <chr>      <chr>              
## 1 rs4245739  3_prime_UTR_variant
## 2 rs2363956  missense_variant   
## 3 rs10069690 intron_variant     
## 4 rs3757318  intron_variant     
## 5 rs10771399 intergenic_variant

Citing this work

{gwasrapidd} was published in Bioinformatics in 2019: https://doi.org/10.1093/bioinformatics/btz605.

To generate a citation for this publication from within R:

citation('gwasrapidd')
## To cite gwasrapidd in publications use:
## 
##   Ramiro Magno, Ana-Teresa Maia, gwasrapidd: an R package to query,
##   download and wrangle GWAS Catalog data, Bioinformatics, btz605, 2
##   August 2019, Pages 1-2, https://doi.org/10.1093/bioinformatics/btz605
## 
## A BibTeX entry for LaTeX users is
## 
##   @Article{,
##     title = {gwasrapidd: an R package to query, download and wrangle GWAS Catalog data},
##     author = {Ramiro Magno and Ana-Teresa Maia},
##     journal = {Bioinformatics},
##     year = {2019},
##     pages = {1--2},
##     url = {https://doi.org/10.1093/bioinformatics/btz605},
##   }

Code of Conduct

Please note that the {gwasrapidd} project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Similar projects

Acknowledgements

This work would have not been possible without the precious help from the GWAS Catalog team, particularly Daniel Suveges.

Copy Link

Version

Install

install.packages('gwasrapidd')

Monthly Downloads

428

Version

0.99.17

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Ramiro Magno

Last Published

December 15th, 2023

Functions in gwasrapidd (0.99.17)

equal_length

Grows vectors to match longest vector
associations_tbl

Creates an associations table.
bind

Bind GWAS Catalog objects
gc_get

Get a GWAS Catalog resource
get_associations_by_study_id

Get GWAS Catalog associations by study identifiers
get_metadata

Get GWAS Catalog metadata
genomic_contexts_tbl

Creates a genomic contexts table.
gc_request

Request a GWAS Catalog REST API endpoint
genotyping_techs_tbl

Creates a genotyping technologies table.
get_studies_by_efo_trait

Get GWAS Catalog studies by EFO traits
get_studies_all

Get all GWAS Catalog studies
get_associations_all

Get all GWAS Catalog associations
get_studies

Get GWAS Catalog studies
get_associations

Get GWAS Catalog associations
get_traits

Get GWAS Catalog EFO traits
entrez_ids_tbl

Creates an Entrez gene identifiers' table.
get_associations_by_association_id

Get GWAS Catalog associations by their association identifiers
get_associations_by_pubmed_id

Get GWAS Catalog associations by PubMed identifiers
get_studies_by_variant_id

Get GWAS Catalog studies by variant identifiers
gc_request_all

Request a paginated GWAS Catalog REST API endpoint
get_traits_all

Get all GWAS Catalog EFO traits
exists_variant

Check if a variant exists in the Catalog.
get_variants_by_association_id

Get GWAS Catalog variants by their association identifiers
get_studies_by_efo_id

Get GWAS Catalog studies by EFO identifier
get_traits_by_efo_uri

Get GWAS Catalog traits by EFO URIs
get_associations_by_efo_id

Get GWAS Catalog associations by EFO identifier
get_studies_by_association_id

Get GWAS Catalog studies by association identifiers
get_variants_all

Get all GWAS Catalog variants
filter_variants_by_standard_chromosomes

Filter variants by standard human chromosomes.
metadata_lst

Generate a list to hold GWAS metadata
is_efo_id2

Is a string an EFO trait ID in the broad sense?
get_traits_by_pubmed_id

Get GWAS Catalog traits by PubMed identifiers
missing_to_na

Recursively map all missing values to NA.
is_efo_id

Is a string an EFO trait ID?
get_studies_by_pubmed_id

Get GWAS Catalog studies by PubMed identifiers
loci_tbl

Creates a loci table.
get_traits_by_association_id

Get GWAS Catalog traits by association identifiers
get_associations_by_efo_trait

Get GWAS Catalog associations by EFO traits
get_variants_by_efo_trait

Get GWAS Catalog variants by EFO traits
get_traits_by_efo_id

Get GWAS Catalog traits by EFO identifier
get_variants_by_gene_name

Get GWAS Catalog variants by gene name.
gc_examples

gwasrapidd entities' examples
get_studies_by_reported_trait

Get GWAS Catalog studies by reported traits
get_traits_by_efo_trait

Get GWAS Catalog traits by EFO traits
open_in_pubmed

Browse PubMed from PubMed identifiers.
study_to_association

Map a study id to an association id
traits_tbl

Creates a traits tibble
get_variants_by_efo_id

Get GWAS Catalog studies by EFO identifier
get_variants_by_cytogenetic_band

Get GWAS Catalog variants by cytogenetic band.
publications_tbl

Creates a publications table.
recursive_apply

Simple rapply version that deals with NULL values.
peel_off_embedded

Peels off the _embedded tier from a JSON-list.
variant_to_trait

Map a variant id to an EFO trait
get_variants_by_variant_id

Get GWAS Catalog variants by variant identifiers
is_study_id

Is a string a GWAS Catalog study accession ID?
studies_tbl

Creates a studies table.
gwasrapidd-package

gwasrapidd: 'REST' 'API' Client for the 'NHGRI'-'EBI' 'GWAS' Catalog
is_embedded

Is the GWAS response wrapped in an '_embedded' object?
traits_drop_na

Drop any NA traits.
is_empty_str

Is string empty or an all whitespace string?
get_child_efo

Get all child terms of this trait in the EFO hierarchy
list_to_s4

Convert a named list to an S4 object
get_associations_by_variant_id

Get GWAS Catalog associations by variant identifiers
get_studies_by_full_pvalue_set

Get GWAS Catalog studies by full summary statistics criterion
is_rs_id

Is a string a valid rsID?
is_pubmed_id

Is a string a PubMed ID?
get_studies_by_efo_uri

Get GWAS Catalog studies by EFO URIs
variants-class

An S4 class to represent a set of GWAS Catalog variants
get_variants

Get GWAS Catalog variants
get_variants_by_reported_trait

Get GWAS Catalog variants by reported traits
get_variants_by_study_id

Get GWAS Catalog variants by study identifiers
open_in_gtex

Browse GTEx from SNP identifiers.
get_traits_by_study_id

Get GWAS Catalog traits by study identifiers
object_type_from_url

Identify the GWAS object entity from the URL endpoint
lstjoin

Joins for lists.
open_in_dbsnp

Browse dbSNP from SNP identifiers.
subset-associations

Subset an associations object
subset-studies

Subset a studies object
traits-class

An S4 class to represent a set of GWAS Catalog EFO traits.
is_association_id

Is a string a GWAS Catalog association accession ID?
get_studies_by_study_id

Get GWAS Catalog studies by study identifiers
get_studies_by_user_requested

Get GWAS Catalog studies that have been requested by users or not
get_variants_by_pubmed_id

Get GWAS Catalog variants by PubMed identifiers
get_variants_by_genomic_range

Get GWAS Catalog variants by genomic range
traits

Constructor for the S4 traits object.
%>%

Pipe operator
n

Number of GWAS Catalog entities
platforms_tbl

Creates a platforms table.
setop

Set operations on GWAS Catalog objects.
set_testing_slow

Setup the environment to still run slow tests
subset-traits

Subset a traits object
subset-variants

Subset a variants object
is_ebi_reachable

Is the GWAS Catalog REST API server reachable?
is_human_chromosome

Is a string a human chromosome name?
variant_to_study

Map a variant id to a study id
variant_to_association

Map a variant id to an association id
normalise_obj

Normalise a JSON-list.
skip_if_testing_is_fast

Skips a test if TEST_FAST is 'true'
is_paginated

Is the GWAS response paginated?
risk_alleles_tbl

Creates a risk alleles table.
reported_genes_tbl

Creates an authors' reported genes table.
variant_name

Extract variant identifiers from strings of the form rs123-G
open_in_gwas_catalog

Browse GWAS Catalog entities from the GWAS Web Graphical User Interface
studies-class

An S4 class to represent a set of GWAS Catalog studies
s4_to_list

Convert an S4 object into a list
studies

Constructor for the S4 studies object.
v_entrez_ids_tbl

Creates a gene Entrez identifiers table.
sure

Are you sure?
studies_drop_na

Drop any NA studies.
tws

Trim whitespace.
variants_tbl

Creates a variants table.
v_ensembl_ids_tbl

Creates a gene Ensembl identifiers table.
trait_to_association

Map an EFO trait id to an association id
set_testing_fast

Setup the environment to skip slow tests
study_to_trait

Map a study id to a EFO trait id
write_xlsx

Export a GWAS Catalog object to xlsx
trait_to_variant

Map an EFO trait id to a variant id
trait_to_study

Map an EFO trait id to a study id
study_to_variant

Map a study id to a variant id
variants_drop_na

Drop any NA variants.
variants

Constructor for the S4 variants object.
association_to_variant

Map an association id to a variant id
association_to_study

Map an association id to a study id
add_object_tier

Adds an element named <obj_type> to content sub-element.
associations-class

An S4 class to represent a set of GWAS Catalog associations
empty_to_na

Converts an empty vector to a scalar NA
associations

Constructor for the S4 associations object.
allele_name

Extract allele names from strings of the form rs123-G
cytogenetic_bands

GRCh38 human cytogenetic bands.
associations_drop_na

Drop any NA associations.
association_to_trait

Map an association id to an EFO trait id
ensembl_ids_tbl

Creates an Ensembl gene identifiers' table.
filter_by_id

Filter GWAS Catalog objects by identifier.
ancestral_groups_tbl

Creates an ancestral groups table.
extract_association_id

Extract association identifiers from URLs
ancestries_tbl

Creates an ancestries table.
child_efo_ids

Get all child terms of this trait in the EFO hierarchy
countries_tbl

Creates a countries table.
contains_question_mark

Does a string contain a question mark?
cytogenetic_band_to_genomic_range

Convert a cytogenetic band string to genomic coordinates.