Summarises how much a fluorophore's spectral variants (rows 2+ of its
variant matrix, as produced by get.spectral.variants()) disagree with
its reference spectrum (row 1) and with each other, returning several
complementary summary metrics per fluorophore.
Arguments
- variant.list
Named list of spectral variant matrices (one per fluorophore), as returned in the
variantselement ofget.spectral.variants(). Row 1 of each matrix is treated as the reference spectrum; rows 2+ are treated as variants.- peak.height
Numeric in
[0, 1], default0.1. Detectors where the reference spectrum falls below this fraction of that fluorophore's own peak value (peak.height * max(reference.spectrum)) are excluded from the denoised variability metric (Denoised_rSD). Relative to the peak rather than an absolute cutoff, so behavior is unchanged whethervariant.listis L-infinity or L2 normalized.
Value
A numeric matrix with one row per fluorophore and four columns:
rSDSum, across detectors, of the robust SD (MAD) of the variant spectra.
ScaledrSDweighted by the reference spectrum, summed across detectors, to downweight low-signal channels.Sim_rSDRobust SD of the pairwise cosine similarities among all variants (including the reference).
Denoised_rSDAs
rSD, but restricted to detectors where the reference spectrum exceedspeak.height.
Returns NULL (with a message) if no fluorophore has usable
variability data.