filterPixels {imcRtools} | R Documentation |
Helper function for estimating the spillover matrix. After assigning each pixel to a spotted mass, this function will filter incorrectly assigned pixels and remove small pixel sets.
filterPixels( object, bc_id = "bc_id", spot_mass = "sample_mass", minevents = 40, correct_pixels = TRUE )
object |
a |
bc_id |
character string indicating which |
spot_mass |
character string indicating which |
minevents |
single numeric indicating the threshold under which pixel sets are excluded from spillover estimation. |
correct_pixels |
logical indicating if incorrectly assigned pixels should be excluded from spillover estimation. |
returns a SingleCellExperiment object in which
colData(object)$bc_id
has been adjusted based on the filter
criteria.
Vito Zanotelli, adapted by Nils Eling (nils.eling@dqbm.uzh.ch)
path <- system.file("extdata/spillover", package = "imcRtools") sce <- readSCEfromTXT(path) assay(sce, "exprs") <- asinh(counts(sce)/5) # Pre-process via CATALYST library(CATALYST) bc_key <- as.numeric(unique(sce$sample_mass)) sce <- assignPrelim(sce, bc_key = bc_key) sce <- estCutoffs(sce) sce <- applyCutoffs(sce) sce <- filterPixels(sce) table(sce$sample_mass, sce$bc_id)