Merges region data for cross-boundary genes

merge_region_data(
  boundary_genes,
  region_data,
  region_info,
  LD_map,
  snp_map,
  weights,
  z_snp,
  z_gene,
  estimate_L = TRUE,
  expand = TRUE,
  L = 5,
  maxSNP = Inf,
  LD_format = c("rds", "rdata", "mtx", "csv", "txt", "custom"),
  LD_loader_fun = NULL,
  snpinfo_loader_fun = NULL,
  ncore = 1,
  verbose = FALSE,
  logfile = NULL,
  ...
)

Arguments

boundary_genes

a data frame of boundary gene info

region_data

a list of original region_data

region_info

a data frame of region definitions

LD_map

a data frame with filenames of LD matrices and SNP information for the regions.

snp_map

a list of data frames with SNP-to-region map for the reference.

weights

a list of preprocessed weights.

z_snp

A data frame with columns: "id", "z", giving the z-scores for SNPs.

z_gene

A data frame with columns: "id", "z", giving the z-scores for genes.

estimate_L

If TRUE, estimate L for merged regions.

expand

If TRUE, expand merged region_data with full SNPs

L

the number of effects for susie.

maxSNP

Inf or integer. Maximum number of SNPs in a region. Default is Inf, no limit. This can be useful if there are many SNPs in a region and you don't have enough memory to run the program.

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 susie over regions

verbose

If TRUE, print detail messages

logfile

The log filename. If NULL, will print log info on screen.

...

Additional arguments of susie_rss.

Value

a list of merged region data, merged region info, LD_map, snp_map, and merged region IDs.