Skip to contents

For each condition's deviation contrast, the proportion of variants whose contrast p-value falls below pCutoff – the "n-significant" feature score of mash_posterior.ipynb. No meta-analysis is involved.

Usage

nSignificantScore(contrastResult, pCutoff = 1e-05)

Arguments

contrastResult

A contrast table from mashPosteriorContrast carrying p_contrast_*_deviation columns.

pCutoff

Significance threshold (default 1e-5).

Value

A data.frame with condition and ratio (\(n_{sig} / n\)).

Examples

om <- matrix(c(0.1, 0.2, 0.3), 1, 3,
  dimnames = list("chr1:100:A:G", c("a", "b", "c")))
pm <- matrix(c(0.5, 0.3, -0.2), 1, 3,
  dimnames = list("chr1:100:A:G", c("a", "b", "c")))
pv <- array(diag(3) * 0.1, dim = c(3, 3, 1))
dimnames(pv) <- list(c("a", "b", "c"), c("a", "b", "c"), NULL)
cr <- fitMashContrast(1L, om, pm, pv)
nSignificantScore(cr, pCutoff = 0.05)
#> # A tibble: 3 × 2
#>   condition ratio
#>   <chr>     <dbl>
#> 1 a             0
#> 2 b             0
#> 3 c             0