Computes LD for weight variants using reference LD

compute_weight_LD_from_ref(
  weights,
  region_info,
  LD_map,
  snp_map = NULL,
  LD_format = c("rds", "rdata", "mtx", "csv", "txt", "custom"),
  LD_loader_fun = NULL,
  snpinfo_loader_fun = NULL,
  ncore = 1
)

Arguments

weights

a list of preprocessed weights.

region_info

a data frame of region definitions.

LD_map

a data frame with filenames of LD matrices and SNP information for the regions. Required when load_predictdb_LD = FALSE.

snp_map

a list of SNP-to-region map for the reference. If NUll, it will reads SNP info from the "SNP_file" column of LD_map.

LD_format

file format for LD matrix. If "custom", use a user defined LD_loader_fun() function to load LD matrix.

LD_loader_fun

a user defined function to load LD matrix when LD_format = "custom".

snpinfo_loader_fun

a user defined function to load SNP information file, if SNP information files are not in standard cTWAS reference format.

ncore

The number of cores used to parallelize computation.

Value

a list of processed weights, with LD of weight variants included.