The four views over a ColocResult. The
object stores one element per tested (QTL credible set, GWAS credible set,
block) pair; these accessors project it to the granularity a given
analysis needs, rather than any one of them being the stored shape.
colocPairs()One row per tested pair – coloc's native
$summarygranularity. Every testable pair is reported verbatim, including both halves of a credible set that straddles a block boundary; interpreting them is the caller's decision.colocVariants()One row per (pair, variant), carrying
colocPp = PP.H4.abf * SNP.PP.H4– the posterior that this variant is the shared causal one. Withpooled = TRUE, one row per (gene, variant) pooled by the rule below.colocCredibleSets()One row per coloc credible set: the smallest set of variants whose cumulative
SNP.PP.H4reachescoverage. This is a THIRD variant set, not guaranteed to be a subset of either input credible set, so its purity is recomputed from LD rather than inherited.colocGenes()One row per gene, pooled across pairs.
Usage
colocPairs(x, ...)
colocVariants(x, pooled = FALSE, ...)
colocCredibleSets(x, coverage = 0.95, minPp4 = NULL, minAbsCorr = 0.8, ...)
colocGenes(x, ...)
# S4 method for class 'ColocResult'
colocPairs(x)
# S4 method for class 'ColocResult'
colocVariants(x, pooled = FALSE)
# S4 method for class 'ColocResult'
colocGenes(x)
# S4 method for class 'ColocResult'
colocCredibleSets(
x,
coverage = 0.95,
minPp4 = NULL,
minAbsCorr = 0.8,
requireMaxH4 = FALSE
)
# S4 method for class 'ColocBoostResult'
colocPairs(x)
# S4 method for class 'ColocBoostResult'
colocVariants(x, pooled = FALSE)Arguments
- x
A
ColocResult.- ...
Additional arguments passed on to methods.
- pooled
Logical.
colocVariants()only: pool to one row per (gene, variant) instead of per (pair, variant).- coverage
Cumulative
SNP.PP.H4the credible set must reach.- minPp4
Optional lower bound on the pair's
PP.H4.abf. Applied before any LD work, so a stricter threshold costs strictly less.- minAbsCorr
Minimum absolute correlation between credible-set members (purity). Requires the object's
ldReference; when that is absent, purity is reported asNAand no set is dropped.- requireMaxH4
Logical (length 1), default
FALSE. WhenTRUE, keep only pairs whosePP.H4.abfis the largest of the five posterior probabilities, i.e. colocalization is the favoured hypothesis rather than merely a probable one.
Pooling
For a fixed QTL credible set i, the per-(block,
GWAS credible set) results j are mutually exclusive – the shared
causal variant is in one block or the other – so they are summed:
min(1, sum_j PP.H4_ij), with a warning when the sum exceeds 1
(several GWAS credible sets competing for one QTL signal, which is
diagnostic). Distinct QTL credible sets are independent signals and
combine as 1 - prod_i (1 - p_i).
Examples
data(qtlFineMappingLbfExample)
data(gwasFineMappingLbfExample)
res <- colocPipeline(
qtlFineMappingResult = qtlFineMappingLbfExample,
gwasInput = gwasFineMappingLbfExample
)
head(colocPairs(res))
#> # A tibble: 6 × 23
#> study context trait method gwasStudy gwasContext gwasTrait gwasMethod blockId
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 test_… contex… ENSG… susie gwas1 NA NA susie region…
#> 2 test_… contex… ENSG… susie gwas1 NA NA susie region…
#> 3 test_… contex… ENSG… susie gwas1 NA NA susie region…
#> 4 test_… contex… ENSG… susie gwas1 NA NA susie region…
#> 5 test_… contex… ENSG… susie gwas1 NA NA susie region…
#> 6 test_… contex… ENSG… susie gwas1 NA NA susie region…
#> # ℹ 14 more variables: qtlCs <int>, gwasCs <int>, nSnps <int>, hit1 <chr>,
#> # hit2 <chr>, PP.H0.abf <dbl>, PP.H1.abf <dbl>, PP.H2.abf <dbl>,
#> # PP.H3.abf <dbl>, PP.H4.abf <dbl>, idx1 <int>, idx2 <int>,
#> # qtlRetainedMass <dbl>, gwasRetainedMass <dbl>
head(colocVariants(res))
#> # A tibble: 6 × 26
#> study context trait method gwasStudy gwasContext gwasTrait gwasMethod blockId
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 test_… contex… ENSG… susie gwas1 NA NA susie region…
#> 2 test_… contex… ENSG… susie gwas1 NA NA susie region…
#> 3 test_… contex… ENSG… susie gwas1 NA NA susie region…
#> 4 test_… contex… ENSG… susie gwas1 NA NA susie region…
#> 5 test_… contex… ENSG… susie gwas1 NA NA susie region…
#> 6 test_… contex… ENSG… susie gwas1 NA NA susie region…
#> # ℹ 17 more variables: qtlCs <int>, gwasCs <int>, nSnps <int>, hit1 <chr>,
#> # hit2 <chr>, PP.H0.abf <dbl>, PP.H1.abf <dbl>, PP.H2.abf <dbl>,
#> # PP.H3.abf <dbl>, PP.H4.abf <dbl>, idx1 <int>, idx2 <int>,
#> # qtlRetainedMass <dbl>, gwasRetainedMass <dbl>, variant_id <chr>,
#> # SNP.PP.H4 <dbl>, colocPp <dbl>
colocGenes(res)
#> # A tibble: 2 × 11
#> study context trait method gwasStudy gwasContext gwasTrait gwasMethod PP.H4
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <dbl>
#> 1 test_s… contex… ENSG… susie gwas1 NA NA susie 0.0278
#> 2 test_s… contex… ENSG… susie gwas1 NA NA susie 0.0267
#> # ℹ 2 more variables: nQtlCs <int>, nPairs <int>
head(colocCredibleSets(res, minPp4 = 0.001))
#> # A tibble: 6 × 29
#> study context trait method gwasStudy gwasContext gwasTrait gwasMethod blockId
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 test_… contex… ENSG… susie gwas1 NA NA susie region…
#> 2 test_… contex… ENSG… susie gwas1 NA NA susie region…
#> 3 test_… contex… ENSG… susie gwas1 NA NA susie region…
#> 4 test_… contex… ENSG… susie gwas1 NA NA susie region…
#> 5 test_… contex… ENSG… susie gwas1 NA NA susie region…
#> 6 test_… contex… ENSG… susie gwas1 NA NA susie region…
#> # ℹ 20 more variables: qtlCs <int>, gwasCs <int>, nSnps <int>, hit1 <chr>,
#> # hit2 <chr>, PP.H0.abf <dbl>, PP.H1.abf <dbl>, PP.H2.abf <dbl>,
#> # PP.H3.abf <dbl>, PP.H4.abf <dbl>, idx1 <int>, idx2 <int>,
#> # qtlRetainedMass <dbl>, gwasRetainedMass <dbl>, csSize <int>,
#> # csCoverage <dbl>, leadVariant <chr>, leadPp <dbl>, csVariants <list>,
#> # purity <dbl>