get_LD_UKB: Download LD matrices from UK Biobank

View source: R/get_LD_UKB.R

get_LD_UKBR Documentation

Download LD matrices from UK Biobank

Description

Download pre-computed LD matrices from UK Biobank in 3Mb windows, then subset to the region that overlaps with query_dat.

LD was derived from a British, European-decent subpopulation in the UK Biobank. LD was pre-computed and stored by the Alkes Price lab. All data is aligned to the hg19 reference genome. For further details, see the PolyFun publication.

Usage

get_LD_UKB(
  query_dat,
  query_genome = "hg19",
  locus_dir,
  chrom = NULL,
  min_pos = NULL,
  force_new_LD = FALSE,
  local_storage = NULL,
  download_full_ld = FALSE,
  download_method = "axel",
  fillNA = 0,
  nThread = 1,
  return_matrix = TRUE,
  as_sparse = TRUE,
  conda_env = "echoR_mini",
  remove_tmps = TRUE,
  subset_common = TRUE,
  verbose = TRUE
)

Arguments

query_dat

SNP-level summary statistics subset to query the LD panel with.

query_genome

Genome build of the query_dat.

locus_dir

Storage directory to use.

force_new_LD

Force new LD subset.

local_storage

Path to folder with previously download LD npz files.

download_method

If "python" will import compressed numpy array directly into R using reticulate. Otherwise, will be passed to downloader to download the full 3Mb-window LD matrix first.

fillNA

Value to fill LD matrix NAs with.

nThread

Number of threads to parallelize over.

as_sparse

Convert the LD matrix to a sparse matrix.

conda_env

Conda environments to search in. If NULL (default), will search all conda environments.

remove_tmps

Remove all intermediate files like vcf, npz, and plink files.

subset_common

Subset LD_matrix and dat to only the SNPs that are common to them both.

verbose

Print messages.

Source

query_dat <- data.table::data.table(CHR=10,POS=c(135000001), SNP="rs1234") locus_dir <- file.path(tempdir(), "locus_A") LD_list <- echoLD:::get_LD_UKB( query_dat = query_dat, locus_dir = locus_dir)

See Also

Other LD: check_population_1kg(), compute_LD(), filter_LD(), get_LD(), get_LD_1KG(), get_LD_1KG_download_vcf(), get_LD_matrix(), get_LD_vcf(), get_locus_vcf_folder(), ldlinkr_ldproxy_batch(), plot_LD(), popDat_1KGphase1, popDat_1KGphase3, rds_to_npz(), saveSparse(), save_LD_matrix(), snpstats_get_MAF()


RajLabMSSM/echoLD documentation built on May 12, 2024, 3:23 a.m.