neighborPurity.Rd
Compute purity of each cell's neighborhood, as defined by KNN graph. For each neighborhood, the proportion of cells belonging to the most represented cluster is computed as the purity score. The Purity score is stored in the metadata of the returned seurat object.
neighborPurity(object, graph, cluster.field = "seurat_clusters", verbose = T)
Seurat object
name of KNN graph to use for analysis. Must be present within provided seurat object. If absent, run FindNeighbors().
name of cluster metadata field to use for cluster membership data. Default is 'seurat_clusters'.
Print progress. Default is TRUE.
Seurat object with purity score stored in metadata
object <- FindNeighbors(object)
#> Error in FindNeighbors(object): object 'object' not found
object <- FindClusters(object, resolution = 1)
#> Error in FindClusters(object, resolution = 1): object 'object' not found
object <- neighborPurity(object, "RNA_nn")
#> Error in graph %in% names(object@graphs): object 'object' not found