R/ctwas_postprocess_region_merging.R
postprocess_region_merging.Rd
Runs cTWAS post-processing procedure for region merging
postprocess_region_merging(
region_info,
region_data,
z_snp,
z_gene,
weights,
LD_map,
snp_map,
finemap_res,
susie_alpha_res,
combine_PIPs = TRUE,
mapping_table = NULL,
L = 5,
group_prior = NULL,
group_prior_var = NULL,
pip_thresh = 0.5,
filter_cs = FALSE,
maxSNP = Inf,
save_cor = FALSE,
cor_dir = NULL,
ncore = 1,
verbose = FALSE,
logfile = NULL,
...
)
a data frame of region definitions.
region_data to be fine-mapped.
A data frame with columns: "id", "z", giving the z-scores for SNPs.
A data frame with columns: "id", "z", giving the z-scores for genes.
a list of preprocessed weights.
a data frame with filenames of LD matrices for the regions.
a list of data frames with SNP-to-region map for the reference.
a data frame of original finemapping result.
a data frame of original susie alpha result.
if TRUE, select boundary genes after combining gene PIPs.
a data frame of mapping between molecular traits and genes, with required columns: "molecular_id", "gene_name".
the number of effects or a vector of number of effects for each region.
a vector of prior inclusion probabilities for different groups. If NULL, it will use uniform prior inclusion probabilities.
a vector of prior variances for different groups.
If NULL, it will set prior variance = 50 as the default in susie_rss
.
PIP cutoff for selecting boundary genes to merge regions.
If TRUE, only select boundary genes in credible sets for region merge.
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.
If TRUE, save correlation (R) matrices to cor_dir
a string, the directory to store correlation (R) matrices
The number of cores used to parallelize computation over regions
If TRUE, print detail messages.
the log file, if NULL will print log info on screen
Additional arguments of finemap_regions
.
a list with region merge results.