Get statistics (p-values) on your gene set's motifbreakR results compared to the bootstrapped empirical null distribution.
Arguments
- mbsmry
Results from running mb_summarize on motifbreakR results from your gene set of interest.
- mbboot
Results from running mb_bootstrap on a full background of all genes. Typically this should be performed once, with results read in from a file.
Value
A tibble with each metric from your bootstrap resampling (see mb_summarize), and p-value comparing the actual value of your gene set (stat
) against the empirical null distribution (bootdist
).
Examples
data(vignettedata)
mbres <- vignettedata$mbres
mball <- vignettedata$mball
mbsmry <- mb_summarize(mbres)
mbsmry
#> # A tibble: 1 × 7
#> ngenes nsnps nstrong alleleDiffAbsMean alleleDiffAbsSum alleleEffectSizeAbsM…¹
#> <int> <int> <int> <dbl> <dbl> <dbl>
#> 1 5 1335 950 0.798 1066. 0.155
#> # ℹ abbreviated name: ¹alleleEffectSizeAbsMean
#> # ℹ 1 more variable: alleleEffectSizeAbsSum <dbl>
set.seed(42)
mbboot <- mb_bootstrap(mball, ngenes=5, boots = 100)
mbboot
#> $bootwide
#> # A tibble: 100 × 9
#> boot genes ngenes nsnps nstrong alleleDiffAbsMean alleleDiffAbsSum
#> <int> <chr> <int> <int> <int> <dbl> <dbl>
#> 1 1 431304;426469;… 5 1062 750 0.797 847.
#> 2 2 426183;395959;… 5 1244 914 0.808 1005.
#> 3 3 102465361;4261… 5 886 655 0.812 720.
#> 4 4 396007;407779;… 5 1514 1139 0.815 1234.
#> 5 5 426883;396544;… 5 925 623 0.787 728.
#> 6 6 425059;429035;… 5 1350 1026 0.821 1109.
#> 7 7 408042;426880;… 5 823 627 0.823 677.
#> 8 8 396170;425058;… 5 1262 910 0.805 1016.
#> 9 9 102466833;4261… 5 1263 963 0.822 1038.
#> 10 10 429035;408042;… 5 1289 987 0.823 1061.
#> # ℹ 90 more rows
#> # ℹ 2 more variables: alleleEffectSizeAbsMean <dbl>,
#> # alleleEffectSizeAbsSum <dbl>
#>
#> $bootdist
#> # A tibble: 6 × 2
#> metric bootdist
#> <chr> <list>
#> 1 alleleDiffAbsMean <dbl [100]>
#> 2 alleleDiffAbsSum <dbl [100]>
#> 3 alleleEffectSizeAbsMean <dbl [100]>
#> 4 alleleEffectSizeAbsSum <dbl [100]>
#> 5 nsnps <dbl [100]>
#> 6 nstrong <dbl [100]>
#>
mb_bootstats(mbsmry, mbboot)
#> # A tibble: 6 × 5
#> metric stat bootdist bootmax p
#> <chr> <dbl> <list> <dbl> <dbl>
#> 1 nsnps 1335 <dbl [100]> 1514 0.12
#> 2 nstrong 950 <dbl [100]> 1139 0.16
#> 3 alleleDiffAbsMean 0.798 <dbl [100]> 0.828 0.84
#> 4 alleleDiffAbsSum 1066. <dbl [100]> 1234. 0.12
#> 5 alleleEffectSizeAbsMean 0.155 <dbl [100]> 0.163 0.47
#> 6 alleleEffectSizeAbsSum 206. <dbl [100]> 238. 0.11