variant_to_trait: Map a variant id to an EFO trait

View source: R/id_mapping.R

variant_to_traitR Documentation

Map a variant id to an EFO trait

Description

Map a variant identifier to an EFO trait identifier. Variants are first mapped to association identifiers, and then to EFO traits. Set the option keep_association_id to TRUE to keep the intermediate mapping, i.e., the association identifiers.

Usage

variant_to_trait(
  variant_id,
  keep_association_id = FALSE,
  verbose = FALSE,
  warnings = TRUE
)

Arguments

variant_id

A character vector of variant identifiers.

keep_association_id

Whether to keep the association identifier in the final output (default is FALSE).

verbose

Whether the function should be verbose about the different queries or not.

warnings

Whether to print warnings.

Value

A dataframe of two or three identifiers. If keep_association_id is set to FALSE, the first column is the variant identifier and the second column is the EFO trait identifier, otherwise the variable association_id is also included as the second column.

Examples

## Not run: 
# Map GWAS variant identifiers to EFO trait identifiers
variant_to_trait(c('rs7904579', 'rs138331350'))

# Map GWAS variant identifiers to EFO trait identifiers
# but keep the intermediate association identifier
variant_to_trait(c('rs7904579', 'rs138331350'), keep_association_id = TRUE)

## End(Not run)


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