get_traits: Get GWAS Catalog EFO traits

View source: R/get_traits.R

get_traitsR Documentation

Get GWAS Catalog EFO traits

Description

Retrieves traits 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 traits 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 traits that match simultaneously all criteria provided, then set set_operation to 'intersection'.

Usage

get_traits(
  study_id = NULL,
  association_id = NULL,
  efo_id = NULL,
  pubmed_id = NULL,
  efo_uri = NULL,
  efo_trait = NULL,
  set_operation = "union",
  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.

efo_id

A character vector of EFO identifiers.

pubmed_id

An integer vector of PubMed identifiers.

efo_uri

A character vector of EFO URIs.

efo_trait

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

set_operation

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

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 trait identifiers at once by passing a vector of identifiers to efo_id.

Value

A traits object.

Examples

## Not run: 
# Get traits by study identifier
get_traits(study_id = 'GCST001085', warnings = FALSE)

# Get traits by association identifier
get_traits(association_id = '25389945', warnings = FALSE)

# Get a trait by its EFO identifier
get_traits(efo_id = 'EFO_0005537', warnings = FALSE)

## End(Not run)


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