Loads precomputed correlation matrices if available in cor_dir
,
otherwise, computes correlation matrices if no precomputed correlation matrices,
or force_compute_cor = TRUE.
get_region_cor(
region_id,
sids,
gids,
LD_map,
weights,
force_compute_cor = FALSE,
save_cor = FALSE,
cor_dir = NULL,
LD_format = c("rds", "rdata", "mtx", "csv", "txt", "custom"),
LD_loader_fun = NULL,
snpinfo_loader_fun = NULL,
verbose = FALSE
)
a character string of region id.
SNP IDs in the region
gene IDs in the region
a data frame with filenames of LD matrices and SNP information for the regions.
a list of preprocessed weights
If TRUE, force computing correlation (R) matrices
If TRUE, save correlation (R) matrices to cor_dir
a string, the directory to store correlation (R) matrices
file format for LD matrix. If "custom", use a user defined
LD_loader_fun()
function to load LD matrix.
a user defined function to load LD matrix when LD_format = "custom"
.
a user defined function to load SNP information file, if SNP information files are not in standard cTWAS reference format.
If TRUE, print detail messages
correlation matrices (R_snp, R_snp_gene and R_gene)