defaultDrops {DropletUtils} | R Documentation |
Call cells according to the number of UMIs associated with each barcode, as implemented in CellRanger.
defaultDrops(m, expected=3000, upper.quant=0.99, lower.prop=0.1)
m |
A real sparse matrix object, either a dgTMatrix or dgCMatrix. Columns represent barcoded droplets, rows represent cells. The matrix should correspond to an individual sample. |
expected |
A numeric scalar specifying the expected number of cells in this sample, as specified in the call to CellRanger. |
upper.quant |
A numeric scalar between 0 and 1 specifying the quantile of the top |
lower.prop |
A numeric scalar between 0 and 1 specifying the fraction of molecules of the |
The defaultDrops
function will call cells based on library size similarly to the CellRanger software suite from 10X Genomics.
Default arguments correspond to an exact reproduction of CellRanger's algorithm, where the number of expected cells was also left at CellRanger default value.
The method considers the upper.quant
quantile of the top expected
barcodes, ordered by decreasing number of UMIs, as a threshold. Any barcodes containing more molecules than lower.prop
times this threshold is considered to be a cell, and is retained for further analysis.
This method may be vulnerable to calling very well-captured background RNA, or missing real cells that were poorly captured. See ?emptyDrops
for an alternative approach.
defaultDrops
will return a logical vector of length ncol(m)
.
Each element of the vector reports whether each column of m
was called as a cell.
Jonathan Griffiths
10X Genomics (2017). Cell Ranger Algorithms Overview. https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/algorithms/overview
# Mocking up some data: set.seed(0) my.counts <- DropletUtils:::simCounts() # Identify likely cell-containing droplets. called <- defaultDrops(my.counts) table(called) # Get matrix of called cells. cell.counts <- my.counts[, called]