Estimate Spillover Spreading Matrix (SSM) from Unmixing and Control Data
Source:R/EstimateSSM.R
EstimateSSM.RdComputes a full Spillover Spreading Matrix (SSM) for a set of fluorophores using precomputed positive/negative control data and an unmixing matrix. This matrix quantifies the extent of signal spreading from each fluorophore into others, aiding in panel design and instrument evaluation in spectral flow cytometry.
Arguments
- SSM_fluor
A character vector of fluorophore names to include in the SSM. Each must have a corresponding
SSMObj_*.rdsfile.- A
A numeric unmixing matrix (detectors × fluorophores) with row names as detector channels and column names as fluorophores.
- custom_ssm_dir
Optional path to a directory containing custom
SSMObj_*.rdsfiles. IfNULL, only built-in files from theUSERMpackage are used.
Value
A numeric matrix of spillover spreading scores, with rows and columns named by SSM_fluor.
Each entry ssm[i, j] represents the spreading from fluorophore i into fluorophore j.
Diagonal entries are set to 0.
Details
For each fluorophore in SSM_fluor, the function loads its corresponding SSM object containing
positive and negative control data. It performs detector-to-fluorophore unmixing using the pseudoinverse
of matrix A, then calculates quantile-based spread metrics for each fluorophore pair.
The spillover spreading score is computed as: $$SS = \sqrt{(S_{\sigma}^2 - R_{\sigma}^2) / \Delta F}$$ where \(S_{\sigma}\) and \(R_{\sigma}\) are the 84th–50th percentile spreads in positive and negative samples, and \(\Delta F\) is the median signal increase in the primary fluorophore.
If \(\Delta F = 0\), the score is set to NA. Negative intermediate values yield imaginary scores,
which are returned as negative square roots.