Calculate Secondary Stain Index and Spillover
Source:R/calculate_secondary_spillover.R
calculate.ssi.RdCalculates the Secondary Stain Index (SSI) and secondary spillover for every fluorophore channel in an unmixed dataset, given a single-stained control and a matched unstained control. SSI is defined as:
$$SSI = \frac{median(pos) - median(neg)}{2 \times rSD(neg)}$$
where rSD is the robust standard deviation (median absolute deviation, MAD). Secondary spillover is defined as:
$$Spillover = \frac{\Delta MFI_{channel}}{\Delta MFI_{on\text{-}channel}}$$
Positive events are identified as single-stained cells whose intensity in the on-target channel exceeds the 99th percentile of the unstained control. Up to 500 of the brightest positive events and up to 500 randomly sampled unstained events are used for robustness and speed.
Arguments
- unstained.unmixed
A numeric matrix of unmixed fluorescence values for the unstained control. Rows are cells; columns are fluorophore channels.
- single.stained.unmixed
A numeric matrix of unmixed fluorescence values for the single-stained control. Must have the same column names as
unstained.unmixed.- fluor.name
Character string. The column name of the target fluorophore (the "on-channel") used to define positive events and calculate \(\Delta MFI_{on\text{-}channel}\).