Skip to contents
  1. Run IterativeLSI on input cells; re-project both input cells and simulated doublets through LSI dimension reduction model.

  2. Optionally fit a UMAP on the LSI cell embeddings (with re-projection validation). Transform doublets onto model space.

Usage

project_doublets(
  mat,
  sim_doublets,
  n_dimensions = 30L,
  n_iterations = 2,
  lsi_method = 1,
  binarize = TRUE,
  corr_cutoff = 0.75,
  scale_dims = FALSE,
  umap_params = list(),
  lsi_params = list(),
  force = FALSE,
  seed = 1,
  batch = TRUE,
  threads = NULL,
  verbose = getOption("MarchR.verbose", FALSE),
  ...
)

Arguments

mat

(IterableMatrix, dgCMatrix) (features x cells) Matrix

sim_doublets

(IterableMatrix, dgCMatrix) Input matrix of simulated doublets

n_dimensions

(numeric) Number of LSI dimensions to retain

n_iterations

(numeric) Number of LSI iterations

lsi_method

(integer or character) Method for TF-IDF normalization. Default is 1 (tf-logidf) to match ArchR doublet inference. See IterativeLSI() for details.

binarize

(logical) Binarize input matrix prior to LSI (ArchR default is TRUE)

corr_cutoff

(numeric) Numeric filter for the correlation of a PC to the sequencing depth. If the PC has a correlation that is greater or equal to the corr_cutoff, it will be excluded from the final matrix.

umap_params

(list) List of parameters to pass to the UMAP function when UMAP projections are computed.

lsi_params

(list) Named overrides for the internal IterativeLSI() fit, e.g. list(preset = "archr"). Defaults set here take precedence only where unspecified. See the function umap in the uwot package.

force

(logical) Return UMAP models regardless of correlation threshold.

seed

(integer) UMAP RNG seed

batch

(logical) Use uwot's batch UMAP optimizations. Default TRUE.

threads

(integer) Per-call override of set_threads(), as in add_doublet_scores(). Default NULL.

verbose

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

Value

A Named list with following elements:

lsi_cells

Dense matrix, cells x dims

lsi_doublets

Dense matrix, simulated_doublets x dims

umap_cells

Dense matrix, cells x 2; NULL if UMAP projection failed

umap_doublets

Dense matrix, simulated_doublets x 2; NULL if UMAP projection failed

Details

Return list of cell embeddings, doublet embeddings, and dimension reduction models.