| tss.sm | R Documentation |
Total-sum scaling (TSS) starts from the assumption that total scale does not change systematically between experimental groups. Use this model when that is a reasonable starting point but you want to express uncertainty about it. For example, if a treatment is expected to redistribute features without changing total biomass, TSS centers the treatment-versus-control scale difference at zero.
tss.sm(X, logComp, gamma = 0.5)
X |
Model matrix passed automatically by |
logComp |
Monte Carlo log-compositions passed automatically by
|
gamma |
Non-negative scalar. Standard deviation of the Gaussian random
shift applied to the scale-model coefficients (in log2 space).
|
Set gamma = 0 to enforce no scale difference. Setting
gamma = 0.5 keeps the expected difference at zero but allows each
scale-model coefficient to vary with SD 0.5 on the log2 scale. Larger values
express less confidence that total scale is unchanged.
ALDEx3 applies this uncertainty to model coefficients: for each draw,
b^{(m)} \sim N(0, \gamma^2 I), and the sample scales are
b^{(m)T} X. Samples with the same covariate values therefore share a
random shift. This differs from sample.sm, which can draw
independent uncertainty for every sample.
A numeric matrix of dimension N x nsample giving Monte Carlo
draws of the log2 scale for each sample (rows) across nsample draws
(columns).
Justin Silverman
Nixon G, Gloor GB, Silverman JD (2025). "Incorporating scale uncertainty in microbiome and gene expression analysis as an extension of normalization". Genome Biology. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1186/s13059-025-03609-3")}
# Center the group-scale difference at zero, with moderate uncertainty.
Y <- matrix(seq_len(60), nrow = 10)
condition <- factor(c("control", "control", "control",
"treatment", "treatment", "treatment"))
fit <- aldex(Y, ~ condition, data.frame(condition), nsample = 20,
scale = tss.sm, gamma = 0.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.