View source: R/utility_functions.R
neighborPurity | R Documentation |
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)
object |
Seurat object |
graph |
name of KNN graph to use for analysis. Must be present within provided seurat object. If absent, run FindNeighbors(). |
cluster.field |
name of cluster metadata field to use for cluster membership data. Default is 'seurat_clusters'. |
verbose |
Print progress. Default is TRUE. |
Seurat object with purity score stored in metadata
Nicholas Mikolajewicz
object <- FindNeighbors(object)
object <- FindClusters(object, resolution = 1)
object <- neighborPurity(object, "RNA_nn")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.