Learn R Programming

LDlinkR (version 1.1.2)

LDtrait: Determine if genomic variants are associated with a trait or disease.

Description

Search if a list of variants (or variants in LD with those variants) have been previously associated with a trait or disease. Trait and disease data is updated nightly from the GWAS Catalog (https://www.ebi.ac.uk/gwas/docs/file-downloads.

Usage

LDtrait(
  snps,
  pop = "CEU",
  r2d = "r2",
  r2d_threshold = 0.1,
  win_size = 5e+05,
  token = NULL,
  file = FALSE
)

Arguments

snps

between 1 - 50 variants, using an rsID or chromosome coordinate (GRCh37) (e.g. "chr7:24966446"). All input variants must match a bi-allelic variant.

pop

a 1000 Genomes Project population, (e.g. YRI or CEU), multiple allowed, default = "CEU". Use the `list_pop` function to see a list of available human reference populations.

r2d

use "r2" to filter desired output from a threshold based on estimated LD R2 (R squared) or "d" for LD D' (D-prime), default = "r2".

r2d_threshold

R2 or D' (depends on 'r2d' user input parameter) threshold for LD filtering. Any variants within -/+ of the specified genomic window and R^2 or D' less than the threshold will be removed. Value needs to be in the range 0 to 1. Default value is 0.1.

win_size

set genomic window size for LD calculation. Specify a value greater than or equal to zero and less than or equal to 1,000,000bp. Default value is -/+ 500,000 bp.

token

LDlink provided user token, default = NULL, register for token at https://ldlink.nci.nih.gov/?tab=apiaccess

file

Optional character string naming a path and file for saving results. If file = FALSE, no file will be generated, default = FALSE.

Value

A data frame of all query variant RS numbers with a list of queried variants in LD with a variant reported in the GWAS Catalog (https://www.ebi.ac.uk/gwas/docs/file-downloads.

Examples

Run this code
# NOT RUN {
LDtrait(snps = "rs456",
                 pop = c("YRI", "CEU"),
                 r2d = "r2",
                 r2d_threshold = "0.1",
                 win_size = "500000",
                 token = Sys.getenv("LDLINK_TOKEN")
                )
         
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab