Skip to contents

Visualize the per-position local false sign rate (lfsr) produced by mf_post_smooth(method = "HMM") as a bubble grid: rows are credible sets, columns are positions, dot size is -log10(lfsr) clamped to [0, cex_max]. Color marks positions where lfsr is at or below lfsr_threshold. For simulated data where the truly affected positions are known, pass truth and dots are recolored by the ground-truth mask.

Usage

mfsusie_plot_lfsr(
  fit,
  lfsr_threshold = 0.01,
  truth = NULL,
  cex_max = 6,
  add_legend = TRUE,
  smooth_method = NULL,
  lfsr_source = c("smoother", "lfsr", "clfsr"),
  save = NULL,
  ...
)

Arguments

fit

an mfsusie / fsusie() fit object that has been post-processed with mf_post_smooth(method = "HMM") (so fit$lfsr_curves is populated).

lfsr_threshold

numeric, color cutoff. Positions with lfsr at or below lfsr_threshold use the CS color; the rest are grey. Default 0.01.

truth

optional ground-truth mask for simulated data. For M = 1: a length-T_1 boolean vector OR a length-K list of length-T_1 boolean vectors (one per CS). For M > 1: a length-M list, each entry a length-T_m boolean vector or list-of-CS-vectors.

cex_max

numeric, upper clamp on -log10(lfsr) for the dot size. Default 6.

lfsr_source

which lfsr to bubble-plot, one of "smoother", "lfsr", "clfsr". Default "smoother".

  • "smoother": reads fit$smoothed[[method]]$lfsr_curves[[m]][[l]], the length-T_m per-position lfsr produced by the smoother. Requires a smoothed payload.

  • "lfsr": alpha-weighted aggregation of the per-variant conditional lfsr matrix, alpha[l, ] %*% clfsr_matrix[l, m], truncated to length T_m. Computed from fit$mu / fit$mu2 so it works on fits that have not been post-smoothed.

  • "clfsr": same alpha-weighted aggregation as "lfsr". The unaggregated p x T_basis[m] conditional matrix is exposed via compute_clfsr_matrix(fit, l, m) for code that needs the per-variant view.

save

optional file path. When non-NULL the bubble grid is written to the file at a size proportional to the number of outcomes and credible sets. The graphics device is selected from the file extension: .pdf, .png, .jpg/.jpeg, or .svg.

...

reserved.

Value

Called for side effect; returns invisible(NULL).

Details

Companion to mfsusie_plot() for HMM-smoothed fits. The function handles single-outcome (M = 1) and multi-outcome (M > 1) fits transparently and takes no m argument; for M > 1 it tiles one bubble panel per outcome using the same layout policy as mfsusie_plot().