normCytof: Bead-based normalization

View source: R/normCytof.R

normCytofR Documentation

Bead-based normalization

Description

an implementation of Finck et al.'s normalization of mass cytometry data using bead standards with automated bead gating.

Usage

normCytof(
  x,
  beads = c("dvs", "beta"),
  dna = c(191, 193),
  k = 500,
  trim = 5,
  remove_beads = TRUE,
  norm_to = NULL,
  assays = c("counts", "exprs"),
  overwrite = TRUE,
  transform = TRUE,
  cofactor = NULL,
  plot = TRUE,
  verbose = TRUE
)

Arguments

x

a SingleCellExperiment.

beads

"dvs" (for bead masses 140, 151, 153 ,165, 175) or "beta" (for bead masses 139, 141, 159, 169, 175) or a numeric vector of masses.

dna

numeric vector of masses corresponding to DNA channels (only one is required; output scatter plot (see Value section) will be generated using the first matching channel).

k

integer width of the median window used for bead smoothing (affects visualizations only!).

trim

a single non-negative numeric. A median+/-trim*mad rule is applied to preliminary bead populations to remove bead-bead doublets and low signal beads prior to estimating normalization factors.

remove_beads

logical. If TRUE, bead events will be removed from the input SingleCellExperiment and returned as a separate object?

norm_to

a flowFrame or character string specifying an FCS file from which to compute baseline bead intensities, and to which the input data should be normalized to.

assays

lnegth 2 character string specifying which assay data to use; both should be in assayNames(x) and correspond to count- and expression-like data, respectively.

overwrite

logical; should the specified assays (both, when transform = TRUE) be overwritten with the normalized data? If FALSE, normalized counts (and expressions, if transform = TRUE) will be stored in assay(s) normcounts/exprs, respectively.

transform

logical; should normalized counts be arcsinh-transformed with the specified cofactor(s)?

cofactor

numeric cofactor(s) to use for optional arcsinh-transformation when transform = TRUE; single value or a vector with channels as names. If NULL, normCytof will try and access the cofactor(s) stored in int_metadata(x), thus re-using the same transformation applied previsouly.

plot

logical; should bead vs. DNA scatters and smoothed bead intensities before vs. after normalization be included in the output?

verbose

logical; should extra information on progress be reported?

Value

a list of the following SingleCellExperiment...

  • data: The filtered input SCE (when remove_beads = TRUE); otherwise, colData columns is_bead and remove indicate whether an event as been identified as a bead or doublet. If overwrite = FALSE, assays normcounts/exprs are added; otherwise, the specified counts/exprs assays are overwritten.

  • beads, removed: SCEs containing subsets of events identified as beads and that were removed, respectively. The latter includes bead-cell and cell-cell doublets)

...and ggplot objects:

  • scatter: scatter plot of DNA vs. bead intensities with indication of the applied gates

  • lines: running-median smoothed bead intensities before and after normalization

Author(s)

Helena L Crowell helena.crowell@uzh.ch

References

Finck, R. et al. (2013). Normalization of mass cytometry data with bead standards. Cytometry A 83A, 483-494.

Examples

data(raw_data)
sce <- prepData(raw_data)

# apply normalization & write normalized data to separate assays
res <- normCytof(sce, beads = "dvs", k = 80, overwrite = FALSE) 

ncol(res$beads)   # no. of bead events
ncol(res$removed) # no. of events removed

res$scatter # plot DNA vs. bead intensities including applied gates
res$lines   # plot smoothed bead intensities before vs. after normalization

# filtered SCE now additionally includes 
# normalized count & expression data
assayNames(res$data)


HelenaLC/CATALYST documentation built on Oct. 16, 2024, 12:21 a.m.