filterDoublets.Rd
This function will filter doublets from an ArchRProject after addDoubletScores() has been run.
filterDoublets(
ArchRProj = NULL,
cutEnrich = 1,
cutScore = -Inf,
filterRatio = 1
)
An ArchRProject
object.
The minimum numeric cutoff for DoubletEnrichment
. This number is equivalent to the number of simulated
doublets identified as a nearest neighbor to the cell divided by the expected number given a random uniform distribution.
The minimum numeric cutoff for DoubletScore
which represents the -log10(binomial adjusted p-value)
for the DoubletEnrichment
.
The maximum ratio of predicted doublets to filter based on the number of pass-filter cells.
For example, if there are 5000 cells, the maximum would be filterRatio * 5000^2 / (100000)
(which simplifies to filterRatio * 5000 * 0.05
).
This filterRatio
allows you to apply a consistent filter across multiple different samples that may have different
percentages of doublets because they were run with different cell loading concentrations.
The higher the filterRatio
, the greater the number of cells potentially removed as doublets.
# Get Test ArchR Project
proj <- getTestProject()
# Add Doublet Scores for Small Project
proj <- addDoubletScores(proj, dimsToUse = 1:5, LSIParams = list(dimsToUse = 1:5, varFeatures=1000, iterations = 2))
# Filter Doublets (Since Low Cells filterRatio has to be high before removing 1 cell!)
proj <- filterDoublets(proj, filterRatio=10)