get_associations: Get GWAS Catalog associations

View source: R/get_associations.R

get_associationsR Documentation

Get GWAS Catalog associations

Description

Retrieves associations via the NHGRI-EBI GWAS Catalog REST API. The REST API is queried multiple times with the criteria passed as arguments (see below). By default all associations that match the criteria supplied in the arguments are retrieved: this corresponds to the default option set_operation set to 'union'. If you rather have only the associations that match simultaneously all criteria provided, then set set_operation to 'intersection'.

Usage

get_associations(
  study_id = NULL,
  association_id = NULL,
  variant_id = NULL,
  efo_id = NULL,
  pubmed_id = NULL,
  efo_trait = NULL,
  set_operation = "union",
  interactive = TRUE,
  verbose = FALSE,
  warnings = TRUE
)

Arguments

study_id

A character vector of GWAS Catalog study accession identifiers.

association_id

A character vector of GWAS Catalog association identifiers.

variant_id

A character vector of GWAS Catalog variant identifiers.

efo_id

A character vector of EFO identifiers.

pubmed_id

An integer vector of PubMed identifiers.

efo_trait

A character vector of EFO trait descriptions, e.g., 'uric acid measurement'.

set_operation

Either 'union' or 'intersection'. This tells how associations retrieved by different criteria should be combined: 'union' binds together all results removing duplicates and 'intersection' only keeps same associations found with different criteria.

interactive

A logical. If all associations are requested, whether to ask interactively if we really want to proceed.

verbose

A logical indicating whether the function should be verbose about the different queries or not.

warnings

A logical indicating whether to print warnings, if any.

Details

Please note that all search criteria are vectorised, thus allowing for batch mode search, e.g., one can search by multiple variant identifiers at once by passing a vector of identifiers to variant_id.

Value

An associations object.

Examples

## Not run: 
# Get an association by study identifier
get_associations(study_id = 'GCST001085', warnings = FALSE)

# Get an association by association identifier
get_associations(association_id = '25389945', warnings = FALSE)

# Get associations by variant identifier
get_associations(variant_id = 'rs3798440', warnings = FALSE)

# Get associations by EFO trait identifier
get_associations(efo_id = 'EFO_0005537', warnings = FALSE)

## End(Not run)


ramiromagno/gwasrapidd documentation built on Jan. 3, 2024, 10:21 p.m.