Given a list of Seurat objects, run non-negative matrix factorization on each sample individually, over a range of target NMF components (k).
multiNMF(
obj.list,
assay = "RNA",
slot = "data",
k = 5:6,
hvg = NULL,
nfeatures = 2000,
L1 = c(0, 0),
min.exp = 0.01,
max.exp = 3,
center = FALSE,
scale = FALSE,
min.cells.per.sample = 10,
hvg.blocklist = NULL,
seed = 123
)
Returns a list of NMF programs, one for each sample and for each
value of 'k'. The format of each program in the list follosw the
structure of nmf
factorization models.
A list of Seurat objects
Get data matrix from this assay
Get data matrix from this slot (=layer)
Number of target components for NMF (can be a vector)
List of pre-calculated variable genes to subset the matrix. If hvg=NULL it calculates them automatically
Number of HVG, if calculate_hvg=TRUE
L1 regularization term for NMF
Minimum average log-expression value for retaining genes
Maximum average log-expression value for retaining genes
Whether to center the data matrix
Whether to scale the data matrix
Minimum numer of cells per sample (smaller samples will be ignored)
Optionally takes a vector or list of vectors of gene names. These genes will be ignored for HVG detection. This is useful to mitigateeffect of genes associated with technical artifacts and batch effects (e.g. mitochondrial), and to exclude TCR and BCR adaptive immune(clone-specific) receptors. If set to `NULL` no genes will be excluded
Random seed
library(Seurat)
data(sampleObj)
geneNMF_programs <- multiNMF(list(sampleObj), k=5)
Run the code above in your browser using DataLab