Assemble a ColocResult from a pair-level
table and the per-pair variant tables that go with it. Callers normally
get one from colocPipeline rather than building it directly.
Arguments
- pairs
A data frame with one row per tested pair, carrying at least the identity columns (
study,context,trait,method,gwasStudy,gwasMethod),blockId,qtlCs,gwasCs,nSnpsandPP.H0.abfthroughPP.H4.abf.- variants
A list, parallel to
pairs' rows, of per-pair data frames with avariant_idcolumn and aSNP.PP.H4column.- ldSketch
Optional genotype panel (see
readGenotypes) for the LD reference, used bygetColocCredibleSetsto compute purity.
Examples
pairs <- data.frame(
study = "s1", context = "c1", trait = "g1", method = "susie",
gwasStudy = "G1", gwasMethod = "susie", blockId = "chr1_1_1000",
qtlCs = 1L, gwasCs = 1L, nSnps = 2L,
PP.H0.abf = 0.1, PP.H1.abf = 0.1, PP.H2.abf = 0.1,
PP.H3.abf = 0.1, PP.H4.abf = 0.6
)
variants <- list(data.frame(
variant_id = c("chr1:100:A:G", "chr1:200:C:T"),
SNP.PP.H4 = c(0.7, 0.3)
))
ColocResult(pairs, variants)
#> ColocResult with 1 colocalized pair(s)
#> QTL studies : s1
#> GWAS studies: G1
#> variants : 2 across all pairs
#> max PP.H4 : 0.6