getMetaPrograms {GeneNMF} | R Documentation |
Extract consensus gene programs (meta-programs)
Description
Run it over a list of NMF models obtained using multiNMF
; it will
determine gene programs that are consistently observed across samples
and values of k.
Usage
getMetaPrograms(
nmf.res,
nMP = 10,
specificity.weight = 5,
weight.explained = 0.5,
max.genes = 200,
metric = c("cosine", "jaccard"),
hclust.method = "ward.D2",
min.confidence = 0.5,
remove.empty = TRUE
)
Arguments
nmf.res |
A list of NMF models obtained from |
nMP |
Total number of meta-programs |
specificity.weight |
A parameter controlling how specific gene should be for each program. 'specificity.weight=0' no constraint on specificity, and positive values impose increasing specificity. |
weight.explained |
Fraction of NMF weights explained by selected genes. For example if weight.explained=0.5, all genes that together account for 50% of NMF weights are used to return program signatures. |
max.genes |
Max number of genes for each programs |
metric |
Metric to calculate pairwise similarity between programs |
hclust.method |
Method to build similarity tree between individual programs |
min.confidence |
Percentage of programs in which a gene is seen (out of programs in the corresponding program tree branch/cluster), to be retained in the consensus metaprograms |
remove.empty |
Whether to remove meta-programs with no genes above confidence threshold |
Value
Returns a list with i) 'metaprograms.genes' top genes for each meta-program; ii) 'metaprograms.metrics' dataframe with meta-programs statistics: a) freq. of samples where the MP is present, b) average silhouette width, c) mean similarity (cosine or Jaccard), d) number of genes in MP, e) number of gene programs in MP; iii) 'programs.similarity': matrix of similarities (Jaccard or cosine) between meta-programs; iv) 'programs.tree': hierarchical clustering of meta-programs (hclust tree); v) 'programs.clusters': meta-program identity for each program
Examples
library(Seurat)
data(sampleObj)
geneNMF_programs <- multiNMF(list(sampleObj), k=5)
geneNMF_metaprograms <- getMetaPrograms(geneNMF_programs, nMP=3)