Skip to contents

Apply a fitted mashr model (from mashModelFit) to a target SumStats set, returning the posterior matrices (PosteriorMean, PosteriorSD, lfsr, ...). This is the posterior step of the mash workflow – mash_fit's second step and mash_posterior's per-analysis-unit computation.

Usage

mashPosterior(
  model,
  sumStats,
  alpha,
  vhat = NULL,
  excludeCondition = character(0),
  outputPosteriorCov = TRUE,
  inputScale = c("auto", "beta", "z")
)

Arguments

model

A fitted mashr model (the mashModelFit output).

sumStats

A single QtlSumStats / GwasSumStats – the target (e.g. strong) set to compute posteriors on.

alpha

mash alpha (match the fit).

vhat

Residual correlation matrix (V); NULL -> identity.

excludeCondition

Character vector of condition (column) names to drop from the target AND the model before computing posteriors (the model's covariances are resized via updateMashModelCov). Default none.

outputPosteriorCov

Return the full posterior covariance array (needed by fitMashContrast). Default TRUE.

inputScale

SumStats -> matrix conversion scale.

Value

The mashr::mash_compute_posterior_matrices() result: a list of PosteriorMean / PosteriorSD / lfsr / NegativeProb (+ PosteriorCov when outputPosteriorCov = TRUE).