Skip to main content

Module normwithin

Module normwithin 

Source
Expand description

Two-colour within-array normalization. Port of limma’s MA.RG (RGList -> MAList), RG.MA (the inverse), and normalizeWithinArrays for the deterministic intensity-dependent methods none/median/loess/ printtiploess. The composite/control methods (which call R’s stats::loess restricted to control spots) and robustspline (normalizeRobustSpline) are out of scope for this pure-Rust statistical port.

Structs§

PrinterLayout
Print-tip layout: ngrid_r * ngrid_c tip groups, each printing nspot_r * nspot_c spots. Spots are laid out as contiguous row blocks, one block per tip, so block t occupies rows [t*nspots, (t+1)*nspots).

Enums§

WithinArrayMethod
Intensity-dependent within-array normalization method. Mirrors the deterministic subset of limma’s normalizeWithinArrays method choices.

Functions§

ma_from_rg
MA.RG: convert foreground/background red–green intensities to an (M, A) pair. Each channel is background-corrected with method/offset (delegating to background_correct_matrix; the rb/gb background matrices may be absent), non-positive corrected intensities become NaN, and then M = log2 R - log2 G, A = (log2 R + log2 G) / 2.
normalize_within_arrays
normalizeWithinArrays on the (M, A) matrix path; returns the normalized M matrix (A is unchanged). weights is an optional full n_probes x n_arrays weight matrix — expand a vector beforehand with crate::weights::as_matrix_weights to match limma’s asMatrixWeights. layout is required for WithinArrayMethod::PrintTipLoess. span and iterations follow limma’s defaults of 0.3 and 4.
rg_from_ma
RG.MA: inverse of ma_from_rg on already-(M, A) data, with R = 2^(A + M/2) and G = 2^(A - M/2).