Skip to contents

Computes a Spillover Spreading Matrix (SSM) related object by applying a user-defined summary method to selected signal channels from positive and negative control datasets.

Usage

ExtractSSM(
  df_pos,
  df_neg,
  cols,
  method,
  PrimaryName,
  SecondaryName,
  id,
  instrument,
  Source,
  Note = NA
)

Arguments

df_pos

A data frame containing positive control samples (e.g., single-stained beads).

df_neg

A data frame containing negative control samples (e.g., unstained or background).

cols

A character vector specifying the signal channels (column names) to include in SSM calculation.

method

A summary function (e.g., mean, median) applied to each channel. Must accept na.rm = TRUE.

PrimaryName

A character string specifying the primary name of the fluorophore.

SecondaryName

A character string specifying the secondary name of the fluorophore or marker.

id

A unique identifier for the SSM signature.

instrument

A character string describing the cytometry instrument used.

Source

A character string indicating the source or origin of the dataset.

Note

Optional notes or annotations. Default is NA.

Value

A list containing:

id

The provided identifier.

PrimaryName

Label for the primary condition.

SecondaryName

Label for the secondary condition.

Signature

A numeric vector of normalized spreading scores across channels.

instrument

Instrument description.

Source

Data source.

Note

Optional notes.

df_pos

Sampled positive control data (max 1000 rows).

df_neg

Sampled negative control data (max 1000 rows).

Details

The Spillover Spreading Matrix (SSM) quantifies the extent of signal spreading from one channel into others, which is critical for panel design and instrument performance evaluation in spectral flow cytometry.

Input data frames are subsetted to the specified channels and randomly sampled (up to 1000 rows) to reduce output size and facilitate downstream visualization.

Examples

if (FALSE) { # \dontrun{
pos <- data.frame(CD3 = rnorm(2000), CD19 = rnorm(2000))
neg <- data.frame(CD3 = rnorm(2000), CD19 = rnorm(2000))
ExtractSSM(df_pos = pos, df_neg = neg, cols = c("CD3", "CD19"),
           method = median, PrimaryName = "FITC", SecondaryName = "CD3",
           id = "FITC_CD3", instrument = "Aurora", Source = "PanelX")
} # }