Title: | Spillover Compensation in Mass Cytometry Data |
---|---|
Description: | Channel interference in mass cytometry can cause spillover and may result in miscounting of protein markers. We develop a nonparametric finite mixture model and use the mixture components to estimate the probability of spillover. We implement our method using expectation-maximization to fit the mixture model. |
Authors: | Marco Guazzini [aut, cre] , Alexander G. Reisach [aut] , Sebastian Weichwald [aut] , Christof Seiler [aut] |
Maintainer: | Marco Guazzini <[email protected]> |
License: | LGPL-3 |
Version: | 1.3.0 |
Built: | 2024-10-31 05:38:42 UTC |
Source: | https://github.com/bioc/spillR |
Compute spillover probability and correct for spillover
compCytof( sce, sce_bead, marker_to_barc, impute_value, overwrite = FALSE, n_cores = 1, naive = FALSE )
compCytof( sce, sce_bead, marker_to_barc, impute_value, overwrite = FALSE, n_cores = 1, naive = FALSE )
sce |
|
sce_bead |
|
marker_to_barc |
Table that maps the marker to the barcode in the beads experiment |
impute_value |
Imputed value for counts that are declared as spillover |
overwrite |
logical; if TRUE data are overwritten if FALSE data are saved in new columns |
n_cores |
Number of computing cores |
naive |
logical; if TRUE use the naive version |
A SingleCellExperiment
object
library(CATALYST) library(dplyr) bc_key <- c(139, 141:156, 158:176) sce_bead <- prepData(ss_exp) sce_bead <- assignPrelim(sce_bead, bc_key, verbose = FALSE) sce_bead <- applyCutoffs(estCutoffs(sce_bead)) sce_bead <- computeSpillmat(sce_bead) data(mp_cells, package = "CATALYST") sce <- prepData(mp_cells) marker_to_barc <- rowData(sce_bead)[, c("channel_name", "is_bc")] |> as_tibble() |> filter(is_bc == TRUE) |> mutate(barcode = bc_key) |> select(marker = channel_name, barcode) spillR::compCytof(sce, sce_bead, marker_to_barc, impute_value = NA)
library(CATALYST) library(dplyr) bc_key <- c(139, 141:156, 158:176) sce_bead <- prepData(ss_exp) sce_bead <- assignPrelim(sce_bead, bc_key, verbose = FALSE) sce_bead <- applyCutoffs(estCutoffs(sce_bead)) sce_bead <- computeSpillmat(sce_bead) data(mp_cells, package = "CATALYST") sce <- prepData(mp_cells) marker_to_barc <- rowData(sce_bead)[, c("channel_name", "is_bc")] |> as_tibble() |> filter(is_bc == TRUE) |> mutate(barcode = bc_key) |> select(marker = channel_name, barcode) spillR::compCytof(sce, sce_bead, marker_to_barc, impute_value = NA)
Compute spillover probability and correct for spillover
compensate( tb_real, tb_bead, target_marker, spillover_markers, impute_value = NA, n_iter = 1000 )
compensate( tb_real, tb_bead, target_marker, spillover_markers, impute_value = NA, n_iter = 1000 )
tb_real |
Data frame or tibble with proteins counts of real experiment |
tb_bead |
Data frame or tibble with proteins counts of bead experiment |
target_marker |
Marker name in real experiment |
spillover_markers |
Marker names in bead experiment |
impute_value |
Value for counts that are declared as spillover |
n_iter |
Maximum number of EM steps |
A list of class spillr
containing
tb_compensate |
corrected real cells |
tb_spill_prob |
probability curve |
convergence |
covergence table of EM algorithm |
tb_real |
input real cells |
tb_bead |
input bead cells |
target_marker |
input marker in real experiment |
spillover_markers |
input markers in bead experiment |
Compute spillover probability and correct for spillover from beads only
compensate_naive( tb_real, tb_bead, target_marker, spillover_markers, impute_value = NA )
compensate_naive( tb_real, tb_bead, target_marker, spillover_markers, impute_value = NA )
tb_real |
Data frame or tibble with proteins counts of real experiment |
tb_bead |
Data frame or tibble with proteins counts of bead experiment |
target_marker |
Marker name in real experiment |
spillover_markers |
Marker names in bead experiment |
impute_value |
Value for counts that are declared as spillover |
A list of class spillr
containing
tb_compensate |
corrected real cells |
tb_spill_prob |
probability curve |
convergence |
covergence table of EM algorithm |
tb_real |
input real cells |
tb_bead |
input bead cells |
target_marker |
input marker in real experiment |
spillover_markers |
input markers in bead experiment |
Generate dataset for vignettes and simulation studies
generate_bead()
generate_bead()
tibble
data frame
set.seed(23) generate_bead()
set.seed(23) generate_bead()
Generate dataset for vignettes and simulation studies
generate_real()
generate_real()
tibble
data frame
set.seed(23) generate_real()
set.seed(23) generate_real()
Compute spillover probability and correct for spillover
plotDiagnostics(sce, ch)
plotDiagnostics(sce, ch)
sce |
A |
ch |
Character string specifying the channel to plot |
A list of ggplot2
plots
library(CATALYST) library(dplyr) bc_key <- c(139, 141:156, 158:176) sce_bead <- prepData(ss_exp) sce_bead <- assignPrelim(sce_bead, bc_key, verbose = FALSE) sce_bead <- applyCutoffs(estCutoffs(sce_bead)) sce_bead <- computeSpillmat(sce_bead) data(mp_cells, package = "CATALYST") sce <- prepData(mp_cells) marker_to_barc <- rowData(sce_bead)[, c("channel_name", "is_bc")] |> as_tibble() |> filter(is_bc == TRUE) |> mutate(barcode = bc_key) |> select(marker = channel_name, barcode) sce <- spillR::compCytof(sce, sce_bead, marker_to_barc, impute_value = NA) plotDiagnostics(sce, "Yb173Di")
library(CATALYST) library(dplyr) bc_key <- c(139, 141:156, 158:176) sce_bead <- prepData(ss_exp) sce_bead <- assignPrelim(sce_bead, bc_key, verbose = FALSE) sce_bead <- applyCutoffs(estCutoffs(sce_bead)) sce_bead <- computeSpillmat(sce_bead) data(mp_cells, package = "CATALYST") sce <- prepData(mp_cells) marker_to_barc <- rowData(sce_bead)[, c("channel_name", "is_bc")] |> as_tibble() |> filter(is_bc == TRUE) |> mutate(barcode = bc_key) |> select(marker = channel_name, barcode) sce <- spillR::compCytof(sce, sce_bead, marker_to_barc, impute_value = NA) plotDiagnostics(sce, "Yb173Di")
Variance stabilizing transform of counts
tfm(x)
tfm(x)
x |
Raw count |
A transformed count