Skip to contents

Build the per-coverage, purity-filtered credible-set tables from a SuSiE / fSuSiE fit and its design matrix. These tables are the csTables input to buildTopLoci.

Usage

computeCsTables(
  fit,
  dataX,
  coverage = NULL,
  secondaryCoverage = c(0.7, 0.5),
  method = "susie",
  csInput = c("X", "Xcorr", "fsusie"),
  minAbsCorr = 0.8,
  medianAbsCorr = NULL
)

Arguments

fit

A SuSiE-family fit (e.g. from susieR::susie) carrying sets, pip, and (for fSuSiE) LBF fields.

dataX

Numeric genotype / design matrix (samples x variants) the fit was computed on; used to assess credible-set purity.

coverage

Numeric primary coverage level, or NULL to use the fit's requested coverage (falling back to 0.95).

secondaryCoverage

Numeric vector of additional coverage levels.

method

Character method token (e.g. "susie", "fsusie").

csInput

One of "X", "Xcorr", "fsusie": how credible-set purity is computed.

minAbsCorr, medianAbsCorr

Purity thresholds (minimum and median absolute correlation).

Value

A named list of per-coverage credible-set tables.

Examples

data(eqtlRegionExample)
X <- eqtlRegionExample$X[, 1:40]
y <- eqtlRegionExample$yRes
fit <- susieR::susie(X, y, L = 5)
#> HINT: nrow(X) = 415 >= 2 * ncol(X) = 80. Consider precomputing sufficient statistics with compute_suff_stat() and fitting with susie_ss() instead -- this avoids holding X in memory at every iteration and lets you reuse XtX across multiple y.
computeCsTables(fit, dataX = X, method = "susie")
#> $CS_95_susie
#> $CS_95_susie$sets
#> $CS_95_susie$sets$cs
#> NULL
#> 
#> $CS_95_susie$sets$coverage
#> NULL
#> 
#> $CS_95_susie$sets$requested_coverage
#> [1] 0.95
#> 
#> 
#> $CS_95_susie$pip
#> chr22:32119788:T:C chr22:32119867:T:G chr22:32119961:T:G chr22:32120053:T:C 
#>                  0                  0                  0                  0 
#> chr22:32120593:A:G chr22:32120636:T:C chr22:32120932:G:A chr22:32120975:A:G 
#>                  0                  0                  0                  0 
#> chr22:32121290:C:T chr22:32121498:A:C chr22:32121635:T:G chr22:32121702:A:G 
#>                  0                  0                  0                  0 
#> chr22:32121936:G:A chr22:32122351:A:G chr22:32122676:A:G chr22:32123055:A:G 
#>                  0                  0                  0                  0 
#> chr22:32123164:T:C chr22:32123383:T:C chr22:32123461:T:C chr22:32123806:C:T 
#>                  0                  0                  0                  0 
#> chr22:32124049:G:A chr22:32124126:C:T chr22:32124147:A:C chr22:32124381:G:A 
#>                  0                  0                  0                  0 
#> chr22:32124644:A:G chr22:32124683:T:C chr22:32124952:C:A chr22:32125308:A:G 
#>                  0                  0                  0                  0 
#> chr22:32125638:A:C chr22:32125730:G:A chr22:32126169:C:T chr22:32126200:A:G 
#>                  0                  0                  0                  0 
#> chr22:32126215:C:T chr22:32126386:G:A chr22:32126486:T:C chr22:32127195:T:C 
#>                  0                  0                  0                  0 
#> chr22:32127370:C:T chr22:32127374:C:T chr22:32127405:C:T chr22:32127470:T:C 
#>                  0                  0                  0                  0 
#> 
#> 
#> $CS_70_susie
#> $CS_70_susie$sets
#> $CS_70_susie$sets$cs
#> NULL
#> 
#> $CS_70_susie$sets$coverage
#> NULL
#> 
#> $CS_70_susie$sets$requested_coverage
#> [1] 0.7
#> 
#> 
#> $CS_70_susie$pip
#> chr22:32119788:T:C chr22:32119867:T:G chr22:32119961:T:G chr22:32120053:T:C 
#>                  0                  0                  0                  0 
#> chr22:32120593:A:G chr22:32120636:T:C chr22:32120932:G:A chr22:32120975:A:G 
#>                  0                  0                  0                  0 
#> chr22:32121290:C:T chr22:32121498:A:C chr22:32121635:T:G chr22:32121702:A:G 
#>                  0                  0                  0                  0 
#> chr22:32121936:G:A chr22:32122351:A:G chr22:32122676:A:G chr22:32123055:A:G 
#>                  0                  0                  0                  0 
#> chr22:32123164:T:C chr22:32123383:T:C chr22:32123461:T:C chr22:32123806:C:T 
#>                  0                  0                  0                  0 
#> chr22:32124049:G:A chr22:32124126:C:T chr22:32124147:A:C chr22:32124381:G:A 
#>                  0                  0                  0                  0 
#> chr22:32124644:A:G chr22:32124683:T:C chr22:32124952:C:A chr22:32125308:A:G 
#>                  0                  0                  0                  0 
#> chr22:32125638:A:C chr22:32125730:G:A chr22:32126169:C:T chr22:32126200:A:G 
#>                  0                  0                  0                  0 
#> chr22:32126215:C:T chr22:32126386:G:A chr22:32126486:T:C chr22:32127195:T:C 
#>                  0                  0                  0                  0 
#> chr22:32127370:C:T chr22:32127374:C:T chr22:32127405:C:T chr22:32127470:T:C 
#>                  0                  0                  0                  0 
#> 
#> 
#> $CS_50_susie
#> $CS_50_susie$sets
#> $CS_50_susie$sets$cs
#> NULL
#> 
#> $CS_50_susie$sets$coverage
#> NULL
#> 
#> $CS_50_susie$sets$requested_coverage
#> [1] 0.5
#> 
#> 
#> $CS_50_susie$pip
#> chr22:32119788:T:C chr22:32119867:T:G chr22:32119961:T:G chr22:32120053:T:C 
#>                  0                  0                  0                  0 
#> chr22:32120593:A:G chr22:32120636:T:C chr22:32120932:G:A chr22:32120975:A:G 
#>                  0                  0                  0                  0 
#> chr22:32121290:C:T chr22:32121498:A:C chr22:32121635:T:G chr22:32121702:A:G 
#>                  0                  0                  0                  0 
#> chr22:32121936:G:A chr22:32122351:A:G chr22:32122676:A:G chr22:32123055:A:G 
#>                  0                  0                  0                  0 
#> chr22:32123164:T:C chr22:32123383:T:C chr22:32123461:T:C chr22:32123806:C:T 
#>                  0                  0                  0                  0 
#> chr22:32124049:G:A chr22:32124126:C:T chr22:32124147:A:C chr22:32124381:G:A 
#>                  0                  0                  0                  0 
#> chr22:32124644:A:G chr22:32124683:T:C chr22:32124952:C:A chr22:32125308:A:G 
#>                  0                  0                  0                  0 
#> chr22:32125638:A:C chr22:32125730:G:A chr22:32126169:C:T chr22:32126200:A:G 
#>                  0                  0                  0                  0 
#> chr22:32126215:C:T chr22:32126386:G:A chr22:32126486:T:C chr22:32127195:T:C 
#>                  0                  0                  0                  0 
#> chr22:32127370:C:T chr22:32127374:C:T chr22:32127405:C:T chr22:32127470:T:C 
#>                  0                  0                  0                  0 
#> 
#> 
#> attr(,"coverage")
#> [1] 0.95 0.70 0.50