A helper function to collapse sets of highly correlated
SNPs within signal clusters. This is recommended to run
before flipAllelesAndGather
, and before
fitBetaColoc
.
collapseHighCorSNPs(
sum_stat,
ld_mat,
ld_mat2 = NULL,
threshold = 0.95,
score = NULL,
plot = TRUE,
snp_id = NULL
)
list of summary statistic tables,
which is a list over signal clusters.
Each element of the list should be a data.frame
describing the eQTL and GWAS summary statistics.
The only column in sum_stat
that is used
by the function is score
(optional)
list of LD matrices across signal clusters
optional second list of LD matrices
(for different populations). it will be returned
alongside the first ld_mat
, which is used
for the collapsing. The second list of LD
matrices is just subset to the same set of SNPs
as the first
threshold on absolute value of correlation for collapsing, e.g. will collapse if SNPs are more correlated (or anti-correlated) than this amount
name of a column of sum_stat data.frames with a score, such that collapsing will choose the highest score SNP per collapsed cluster. Otherwise, if set to NULL, the first SNP will be used
logical, draw a before/after grid of plots
name of SNP id column in sum_stat
,
if specified will output a column collapsed
that lists which SNP ids are represented in the output
(i.e. which highly correlated SNPs were collapsed).
list with subset ld_mat
and sum_stat
lists (and ld_mat2
if provided)