% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/link_LD.R
\name{link_LD}
\alias{link_LD}
\title{Obtain LD at a locus from LDlink}
\usage{
link_LD(
  loc,
  pop = "CEU",
  r2d = "r2",
  token = "",
  method = c("proxy", "matrix"),
  genome_build = loc$genome,
  ...
)
}
\arguments{
\item{loc}{Object of class 'locus' generated by \code{\link[=locus]{locus()}}}

\item{pop}{A 1000 Genomes Project population, (e.g. YRI or CEU), multiple
allowed, default = "CEU". Passed to \code{LDlinkR::LDmatrix()}.}

\item{r2d}{Either "r2" for LD r^2 or "d" for LD D', default = "r2". Passed
to \code{LDlinkR::LDmatrix()} or \code{LDproxy()}.}

\item{token}{Personal access token for accessing 1000 Genomes LD data via
LDlink API. See \code{LDlinkR} package documentation.}

\item{method}{Either \code{"proxy"} or \code{"matrix"}. Controls whether to use
\code{LDproxy()} or \code{LDmatrix()} to obtain LD data.}

\item{genome_build}{Choose between one of the three options: 'grch37' for
genome build GRCh37 (hg19), 'grch38' for GRCh38 (hg38), or
'grch38_high_coverage' for GRCh38 High Coverage (hg38) 1000 Genome Project
data sets. Default is GRCh37 (hg19).}

\item{...}{Optional arguments which are passed on to \code{LDlinkR::LDmatrix()} or
\code{LDlinkR::LDproxy()}}
}
\value{
Returns a list object of class 'locus'. LD information is added as a
column \code{ld} in list element \code{data}.
}
\description{
Adds LD information to a 'locus' class object. It queries LDlink
(https://ldlink.nci.nih.gov/) via the \code{LDlinkR} package to retrieve linkage
disequilibrium (LD) information on a reference SNP.
}
\details{
The argument \code{method} controls which LDlinkR function is used to retrieve LD
data. \code{LDmatrix()} is slower but usually more complete for small queries
(<1000 SNPs). However, it has a limit of 1000 SNPs which can be queried.
\code{LDproxy()} is faster but data on some SNPs may be absent.

Note, SNPs have to be correctly formatted as required by LDlinkR, either as
rsID (works with either method) or chromosome coordinate e.g. "chr7:24966446"
(works with LDproxy only). Default genome build is \code{grch37}, see \code{LDproxy()}
or \code{LDmatrix()}.
}
\seealso{
\code{\link[=locus]{locus()}}
}
