get_gwas_variants: Get the variants from the gwas catalog associated to the...

View source: R/gwas.R

get_gwas_variantsR Documentation

Get the variants from the gwas catalog associated to the traits of interest

Description

uses subsetByTraits to get the variants.

Usage

get_gwas_variants(gwas_traits, gwas_cat)

Arguments

gwas_traits

a vector of gwas traits, can be obtained from list_gwas_traits

gwas_cat

output from create_gwas

Value

a data.frame contaning the variants linked to the traits in the gwas catalog The data.frame contains the following columns:

  • chr (chromosome)

  • pos (position of the variant)

  • rsid (variant ID)

  • ensembl_gene_id ("gene id" of the gene associated with the variants)

  • hgnc_symbol ("hgnc symbol" of the gene associated with the variants)

  • source (here "gwas")

Examples

# if you need to get the list of gwas traits:
# list_gwas_traits(keywords = c("Obesity"))
obesity_gwas <- c("Obesity (extreme)", "Obesity-related traits", "Obesity")
gwas_cat <- create_gwas()

gwas_variants <- get_gwas_variants(obesity_gwas, gwas_cat)

MCorentin/vargen documentation built on Feb. 6, 2024, 2:32 p.m.