Main user-facing entry point. Given a SummarizedExperiment::SummarizedExperiment with a methylation assay and a GenomicRanges::GRanges of predefined regions, BREAD maps probes to regions, summarizes them per sample, and fits Bayesian region-level models to produce posterior probabilities of directional methylation change under the contrast of interest. Regions are classified as hypermethylated, hypomethylated, or inconclusive.
Arguments
- se
A SummarizedExperiment::SummarizedExperiment with a methylation assay.
- features
A GenomicRanges::GRanges of user-defined regions.
- design
A one-sided formula giving the model design, e.g.
~ group + sex.- contrast
Character coefficient name of interest. If
NULL(default), the first non-intercept coefficient is used and a message is emitted.- delta
Effect-size threshold on the M-value scale. Default
0.10.- prob_cutoff
Posterior probability cutoff for classification. Default
0.95.- min_probes
Minimum probes per region. Default
3.- feature_class_col
Column in
mcols(features)giving feature class (used byplot_feature_set(); reserved for class-level pooling in M3).- summary_fun
Region summary:
"mean"(default),"median","weighted_mean", or"pc1".- assay_name
Assay name in
se.NULLauto-detects.- input_scale
"M"or"Beta".NULLauto-detects from value range.- backend
One of
"conjugate"(default) or"brms".- prior
Optional
bread_prior()object (conjugate backend only).- ...
Additional arguments forwarded to the backend. For
backend = "brms", this acceptsiter,chains,cores,seed, etc.
Value
A BreadFit object. Use results(), classifications(), or
posterior_draws() to inspect.
Minimal call
The typical call is:
Everything else has a sensible default. In particular:
contrastdefaults to the first non-intercept coefficient,assay_nameauto-detects from the first assay that looks like methylation (prefers"M","betas","Beta","beta"),input_scaleauto-detects from the assay value range ([0,1]→"Beta", otherwise"M").
Backends
Default is an exact conjugate Normal-Inverse-Gamma posterior (fast, no
MCMC). backend = "brms" routes to brms::brm() (one compile + per-region
updates); MCMC controls iter, chains, cores, seed can be passed
through ... to fit_bread_brms().