Function to convert labelled seurat object to avg expression matrix — seurat_ref (original) (raw)
Function to convert labelled seurat object to avg expression matrix
Usage
seurat_ref(seurat_object, ...)
# S3 method for class 'Seurat'
seurat_ref(
seurat_object,
cluster_col = "classified",
var_genes_only = FALSE,
assay_name = NULL,
method = "mean",
subclusterpower = 0,
if_log = TRUE,
...
)
Arguments
seurat_object after tsne or umap projections and clustering
additional arguments
column name where classified cluster names are stored in seurat meta data, cannot be "rn"
whether to keep only var_genes in the final matrix output, could also look up genes used for PCA
any additional assay data, such as ADT, to include. If more than 1, pass a vector of names
whether to take mean (default) or median
whether to get multiple averages per original cluster
input data is natural log, averaging will be done on unlogged data
Value
reference expression matrix, with genes as row names, and cell types as column names
Examples
so <- so_pbmc()
ref <- seurat_ref(so, cluster_col = "seurat_clusters")