Run barcodeRanks on a count matrix provided in a SingleCellExperiment object. Distinguish between droplets containing cells and ambient RNA in a droplet-based single-cell RNA sequencing experiment.

runBarcodeRankDrops(
  inSCE,
  sample = NULL,
  useAssay = "counts",
  lower = 100,
  fitBounds = NULL,
  df = 20
)

Arguments

inSCE

A SingleCellExperiment object. Must contain a raw counts matrix before empty droplets have been removed.

sample

Character vector. Indicates which sample each cell belongs to emptyDrops will be run on cells from each sample separately. If NULL, then all cells will be processed together. Default NULL.

useAssay

A string specifying which assay in the SCE to use.

lower

See emptyDrops for more information. Default 100.

fitBounds

See emptyDrops for more information. Default NULL.

df

See emptyDrops for more information. Default 20.

Value

A SingleCellExperiment object with the barcodeRanks output table appended to the colData slot. The columns include dropletUtils_BarcodeRank_Knee and dropletUtils_BarcodeRank_Knee Please refer to the documentation of barcodeRanks for details.

Examples

# The following unfiltered PBMC_1k_v3 data were downloaded from
# https://support.10xgenomics.com/single-cell-gene-expression/datasets/3.0.0
# /pbmc_1k_v3
# Only the top 10 cells with most counts and the last 10 cells with non-zero
# counts are included in this example.
# This example only serves as an proof of concept and a tutoriol on how to
# run the function. The results should not be
# used for drawing scientific conclusions.
data(scExample, package = "singleCellTK")
sce <- runBarcodeRankDrops(inSCE = sce)
#> Thu Apr 28 11:27:40 2022 ... Running 'barcodeRanks'