View source: R/SimulationFunctions.R
MeanAcrossClusters | R Documentation |
Wrangling function: Take count mat and summarize into mean across selected columns (eg by columns that are from same cluster)
MeanAcrossClusters(count.mat, cnames.keep.lst, jfunc = rowMeans)
count.mat |
Count matrix, usually rows are genes and columns are cells |
cnames.keep.lst |
List where names are cluster identities, values in list are column names that are to be summarized |
jfunc |
Summarizing function, default is rowMeans |
List of count vectors with same names as cnames.keep.lst. Count values are across rows of the matrix
cnames.keep.lst <- lapply(split(dat.final.annots, f = dat.final.annots$cluster), function(x) x$cell) # create cluster to cell input list
prob.mat.byclst.lst <- MeanAcrossClusters(prob.mat, cnames.keep.lst = cnames.keep.lst) # average probabilities across clusters
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.