Skip to contents

Run a Linked Non-negative Matrix Factorization to separate shared and unique signals for integration or signature extraction.

S3 method for Seurat that runs the singlet::RunLNMF function.

Usage

# S3 method for Seurat
RunLNMF(
  object,
  split.by,
  reduction.use = "nmf",
  reduction.name = "lnmf",
  reduction.key = "LNMF_",
  verbose = TRUE,
  link.cutoff = 0.5,
  tol = 1e-05,
  maxit = 100,
  L1 = 0.01,
  L2 = 0,
  threads = 0,
  link.balance.tol = 0,
  balance.maxit = 100,
  link.balance.rate = 0.1,
  ...
)

RunLNMF(object, ...)

MetadataPlot(object, ...)

# S3 method for Seurat
MetadataPlot(object, split.by, reduction = "lnmf", ...)

GetSharedFactors(object, split.by, reduction = "lnmf")

GetUniqueFactors(object, split.by, reduction = "lnmf")

Arguments

object

A Seurat object

split.by

column name in @meta.data giving a Factor with multiple levels for splitting. Data will be weighted such that each group contributes equally to the LNMF model.

reduction.use

NMF reduction to use for initializing the linked factorization.

reduction.name

name to store resulting DimReduc object as

reduction.key

key for resulting DimReduc

verbose

print fitting progress to console

link.cutoff

if the relative contribution of samples in any given group to a factor falls below link.cutoff, unlink it from the factor. link.cutoff = 1 means a factor must contribute exactly equally before being unlinked.

tol

tolerance of the fit (correlation distance of the model across consecutive iterations).

maxit

maximum number of fitting iterations

L1

L1/LASSO penalty to increase sparsity of the model

L2

L2/Ridge-like penalty to increase angles between factors

threads

number of threads to use (0 = let OpenMP use all available threads)

link.balance.tol

relative change in factor representation within sample groups between balancing iterations at which to call convergence.

balance.maxit

maximum number of iterations for the balancing step

link.balance.rate

proportion of difference between current factor weight and equal representation of factors in a sample group to target in a single iteration (default 0.1).

...

not implemented

reduction

reduction to use for metadata analysis

link.balance

after initial linking step, weight all shared factors such that each dataset is represented as equally as possible in each factor.

Value

Returns a Seurat object with the NMF model stored in the reductions slot

Details

Use set.seed() to guarantee reproducibility!