A wrapper function for doubletCells. Identify potential doublet cells based on simulations of putative doublet expression profiles. Generate a doublet score for each cell.

runDoubletCells(
  inSCE,
  sample = NULL,
  useAssay = "counts",
  nNeighbors = 50,
  simDoublets = max(10000, ncol(inSCE)),
  seed = 12345,
  size.factors.norm = NULL,
  size.factors.content = NULL,
  subset.row = NULL,
  block = 10000,
  d = 50,
  force.match = FALSE,
  force.k = 20,
  force.ndist = 3,
  BNPARAM = BiocNeighbors::KmknnParam(),
  BSPARAM = BiocSingular::bsparam(),
  BPPARAM = BiocParallel::SerialParam()
)

Arguments

inSCE

A SingleCellExperiment object.

sample

Character vector. Indicates which sample each cell belongs to. doubletCells will be run on cells from each sample separately.

useAssay

A string specifying which assay in the SCE to use.

nNeighbors

Number of nearest neighbors used to calculate density for doublet detection. Default 50.

simDoublets

Number of simulated doublets created for doublet detection. Default 10000.

seed

Seed for the random number generator. Default 12345.

size.factors.norm

A numeric vector of size factors for normalization of x prior to PCA and distance calculations. If NULL, defaults to size factors derived from the library sizes of x. For the SingleCellExperiment method, the default values are taken from sizeFactors(x), if they are available.

size.factors.content

A numeric vector of size factors for RNA content normalization of x prior to simulating doublets. #' This is orthogonal to the values in size.factors.norm

subset.row

See ?"scran-gene-selection".

block

An integer scalar controlling the rate of doublet generation, to keep memory usage low.

d

An integer scalar specifying the number of components to retain after the PCA.

force.match

A logical scalar indicating whether remapping of simulated doublets to original cells should be performed.

force.k

An integer scalar specifying the number of neighbours to use for remapping if force.match=TRUE.

force.ndist

A numeric scalar specifying the bandwidth for remapping if force.match=TRUE.

BNPARAM

A BiocNeighborParam object specifying the nearest neighbor algorithm. This should be an algorithm supported by findNeighbors.

BSPARAM

A BiocSingularParam object specifying the algorithm to use for PCA, if d is not NA.

BPPARAM

A BiocParallelParam object specifying whether the neighbour searches should be parallelized.

Value

A SingleCellExperiment object with the 'scran_doubletCells_score' column added to the colData slot.

Details

This function is a wrapper function for doubletCells. runDoubletCells runs doubletCells for each sample within inSCE iteratively. The resulting doublet scores for all cells will be appended to the colData of inSCE.

References

Lun ATL (2018). Detecting doublet cells with scran. https://ltla.github.io/SingleCellThoughts/software/doublet_detection/bycell.html

See also

Examples

data(scExample, package = "singleCellTK") sce <- sce[, colData(sce)$type != 'EmptyDroplet'] sce <- runDoubletCells(sce)
#> Mon Oct 5 10:12:55 2020 ... Running 'doubletCells'