Removes ambient RNA from datasets

perform.decontX(counts = counts)

Arguments

counts

Counts matrix

z

Cluster assignments for cells

maxIter

Maximum number of iterations to be performed

delta

Numeric Vector of length 2. Concentration parameters for the Dirichlet prior for the contamination in each cell. The first element is the prior for the native counts while the second element is the prior for the contamination counts. These essentially act as pseudocounts for the native and contamination in each cell. If estimateDelta = TRUE, this is only used to produce a random sample of proportions for an initial value of contamination in each cell. Then fit_dirichlet is used to update delta in each iteration. If estimateDelta = FALSE, then delta is fixed with these values for the entire inference procedure. Fixing delta and setting a high number in the second element will force decontX to be more aggressive and estimate higher levels of contamination at the expense of potentially removing native expression. Default c(10, 10).

estimateDelta

Boolean. Whether to update delta at each iteration.

iterLogLik

Integer. Calculate log likelihood every iterLogLik iteration. Default 10.

varGenes

Integer. The number of variable genes to use in dimensionality reduction before clustering. Variability is calcualted using modelGeneVar function from the 'scran' package. Used only when z is not provided. Default 5000.

dbscanEps

Numeric. The clustering resolution parameter used in 'dbscan' to estimate broad cell clusters. Used only when z is not provided. Default 1.

print.plot

Logical. Should the UMAP plot displaying contaimination in each cell be printed? Default = FALSE

verbose

Logical. Should function information be printed to the console? Default = FALSE

seed

Integer. Passed to with_seed. For reproducibility. Default = 1234

Value

Doublet-omitted sparse matrix

Examples

counts <- perform.decontx(counts = counts)
#> Error in perform.decontx(counts = counts): could not find function "perform.decontx"