Get proxies for variants from plink binary

get_proxies(
  x,
  stat = "r2-unphased",
  win_kb = 1000,
  win_r2 = 0.2,
  win_ninter = Inf,
  proxy_eaf = NULL,
  plink2 = genepi.utils::which_plink2(),
  pfile = genepi.utils::which_1000G_reference(build = "GRCh37"),
  ...
)

Arguments

x

a character vector of rsids or a GWAS object

stat

character, the R stat to calculate, one of "r2-unphased", "r2-phased", "r-unphased", "r-phased"

win_kb

numeric, the window to look in around the variants

win_r2

numeric, the lower r2 limit to include in output, (for –r-phased and –r-unphased, this means |r|≥sqrt(0.2))

win_ninter

numeric, controls the maximum number of other variants allowed between variant-pairs in the report. Inf = off.

proxy_eaf

numeric, the minimal effect allele frequency for proxy variants. NULL = eaf filtering off.

character / path, the plink2 executable

pfile

character / path, the plink pfile set

...

other arguments (see below)

snps

a character vector (available if x is a GWAS object), a vector of rsids to ensure exist, or else try and find proxies for

then

a string (available if x is a GWAS object), either add (adds proxies to current GWAS) or subset (subsets GWAS to variants and potential proxies for variants in x)

Value

a data.table of variants and their proxies (if x is a character vector) or a GWAS object if x is a GWAS object.