GenerateLabels
returns a list of cell type and cell state labels, as well as novel cellular phenotypes and unclassified cells.
GenerateLabels( cr, E = NULL, smooth = TRUE, new_populations = NULL, new_categories = NULL, min.cells = 10, spring.dir = NULL )
cr | list returned by |
---|---|
E | a sparse gene (rows) by cell (column) matrix, or a Seurat object. Rows are HUGO symbols. |
smooth | if TRUE, smooths the cell type classifications. Default is TRUE. |
new_populations | Character vector specifying any new cell types that were learned by Signac. Default is NULL. |
new_categories | If new_populations are set to a cell type, new_category is a corresponding character vector indicating the population that the new population belongs to. Default is NULL. |
min.cells | If desired, any cell population with equal to or less than N cells is set to "Unclassified." Default is 10 cells. |
spring.dir | If using SPRING, directory to categorical_coloring_data.json. Default is NULL. |
A list of cell type labels for cell types, cell states and novel populations.
if (FALSE) { # download single cell data for classification file.dir = "https://cf.10xgenomics.com/samples/cell-exp/3.0.0/pbmc_1k_v3/" file = "pbmc_1k_v3_filtered_feature_bc_matrix.h5" download.file(paste0(file.dir, file), "Ex.h5") # load data, process with Seurat library(Seurat) E = Read10X_h5(filename = "Ex.h5") pbmc <- CreateSeuratObject(counts = E, project = "pbmc") # run Seurat pipeline pbmc <- SCTransform(pbmc, verbose = FALSE) pbmc <- RunPCA(pbmc, verbose = FALSE) pbmc <- RunUMAP(pbmc, dims = 1:30, verbose = FALSE) pbmc <- FindNeighbors(pbmc, dims = 1:30, verbose = FALSE) # download bootstrapped reference data for training models file.dir = "https://github.com/mathewchamberlain/Signac/blob/master/data/" file = "training_HPCA.rda" download.file(paste0(file.dir, file, "?raw=true"), destfile = "training_HPCA.rda") load("training_HPCA.rda") # classify cells labels = SignacFast(E = pbmc, R = training_HPCA) celltypes = GenerateLabels(labels, E = pbmc) }