Skip to contents

For each real cell, compute the fraction of its k-nearest neighbors in a combined (cells + simulated doublets) embedding that are simulated doublets, then normalise to an enrichment score relative to the expected fraction

Usage

score_doublets(
  project_res,
  scoring_method = c("UMAP", "LSI"),
  knn_method = knn_hnsw(k = 10L, metric = "euclidean", ef = 200L),
  verbose = getOption("MarchR.verbose", FALSE),
  ...
)

Arguments

project_res

(list) Named list containing reduced dimension projection results returned by project_doublets.

scoring_method

(character) The name of the dimensionality reduction method to use for k-nearest neighbors calculation and scoring. Possible values are "UMAP" or "LSI". Default and recommended is "UMAP".

knn_method

(function) KNN method. Default knn_hnsw(k = 10L, metric = "euclidean", ef = 200L). Put KNN-specific arguments such as k or metric inside the partial function.

verbose

(logical) Print progress messages. Default getOption("MarchR.verbose", FALSE).

Value

A list with one row per real cell:

doublet_score

-log10(Bonferroni-adjusted binomial p-value)

doublet_enrichment

observed / expected doublet neighbor fraction