Skip to contents

Run NMF on a sparse matrix with automatic rank determination by cross-validation

Usage

run_nmf(
  A,
  rank,
  tol = 1e-04,
  maxit = 100,
  verbose = TRUE,
  L1 = 0.01,
  L2 = 0,
  threads = 0
)

Arguments

A

sparse matrix (ideally variance-stabilized) of data for genes x cells (rows x columns)

rank

factorization rank

tol

tolerance of the fit (1e-5 for publication quality, 1e-3 for cross-validation)

maxit

maximum number of iterations

verbose

verbosity level

L1

L1/LASSO penalty to increase sparsity of model

L2

L2/Ridge penalty to increase angles between factors

threads

number of threads for parallelization across CPUs, 0 = use all available threads