normCytof: Bead-based normalization

Description Usage Arguments Value Author(s) References Examples

View source: R/normCytof.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
normCytof(
  x,
  beads,
  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.

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...

...and ggplot objects:

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
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)

CATALYST documentation built on Nov. 8, 2020, 6:53 p.m.