filterCells {miQC}R Documentation

filterCells

Description

Find those cells probabilistically determined to be compromised by the mixture model and remove them from the dataset.

Usage

filterCells(sce, model = NULL, posterior_cutoff = 0.75, verbose = TRUE)

Arguments

sce

(SingleCellExperiment) Input data object.

model

(flexmix) Output of mixtureModel function, which should be explicitly called first to ensure stability of model parameters. Default = NULL.

posterior_cutoff

(numeric) The posterior probability of a cell being part of the compromised distribution, a number between 0 and 1. Any cells below the appointed cutoff will be marked to keep. Default = 0.75

verbose

(boolean) Whether to report how many cells (columns) are being removed from the SingleCellExperiment object. Default = TRUE

Value

Returns a SingleCellExperiment object, the same as the input except with a new column in colData, prob_compromised, and all cells with greater than the set posterior probability removed from the dataset.

Examples

library(scRNAseq)
library(scater)
library(BiocParallel)
sce <- ZeiselBrainData()
mt_genes <- grepl("^mt-",  rownames(sce))
feature_ctrls <- list(mito = rownames(sce)[mt_genes])
sce <- addPerCellQC(sce, subsets = feature_ctrls, BPPARAM = MulticoreParam())
model <- mixtureModel(sce)
sce <- filterCells(sce, model)

[Package miQC version 1.0.0 Index]