Posterior contrast table over an entire mash posterior
Source:R/mashPipeline.R
mashPosteriorContrast.RdOrchestrates fitMashContrast across every feature (variant)
of a mash posterior: aligns the original effect matrix to the posterior
columns, runs the per-feature deviation + pairwise contrast, row-binds the
results (aligning the union of contrast columns), and orders them
(mean/se/p, deviation before pairwise). Features with
fewer than two tested conditions are dropped.
Arguments
- posteriorMean
Numeric matrix (features x conditions) of posterior means (
PosteriorMeanfrommashPosterior).- posteriorVcov
Numeric array (conditions x conditions x features) of posterior covariances (
PosteriorCov).- origMean
Numeric matrix (features x conditions) of the original effect estimates (e.g.
bhat); used to decide which conditions were tested per feature. Aligned toposteriorMean's columns by name;NaNis treated as 0 (untested).- grouping
Optional named integer vector assigning conditions to groups (0 = independent); forwarded to
fitMashContrastso replicate populations of one cell type share weight. Names are condition labels.
Value
A data.frame (features x contrasts) with
mean_contrast_*, se_contrast_*, p_contrast_* columns
and feature ids as row names. Empty when nothing is testable.