Description Usage Arguments Value Author(s) See Also Examples
Determine whether cells are surrounded by neighbors that are assigned to the same cluster.
This function has now been deprecated in favor of neighborPurity
from the bluster package.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | clusterPurity(x, ...)
## S4 method for signature 'ANY'
clusterPurity(x, ..., transposed = FALSE, subset.row = NULL)
## S4 method for signature 'SummarizedExperiment'
clusterPurity(x, ..., assay.type = "logcounts")
## S4 method for signature 'SingleCellExperiment'
clusterPurity(
x,
clusters = colLabels(x, onAbsence = "error"),
...,
assay.type = "logcounts",
use.dimred = NULL
)
|
x |
A matrix-like object containing expression values for each gene (row) in each cell (column).
These dimensions can be transposed if Alternatively, a SummarizedExperiment or SingleCellExperiment containing such an expression matrix.
If |
... |
For the generic, arguments to pass to specific methods. For the ANY method, arguments to pass to For the SummarizedExperiment method, arguments to pass to the ANY method. For the SingleCellExperiment method, arguments to pass to the SummarizedExperiment method. |
transposed |
A logical scalar indicating whether |
subset.row |
See |
assay.type |
A string specifying which assay values to use. |
clusters |
A vector or factor of cluster IDs to pass to |
use.dimred |
A string specifying whether existing values in |
A DataFrame of purity statistics where each row corresponds to a cell in x
,
see ?neighborPurity
for details.
Aaron Lun
approxSilhouette
, for another method of evaluating cluster separation.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | library(scuttle)
sce <- mockSCE()
sce <- logNormCounts(sce)
g <- buildSNNGraph(sce)
clusters <- igraph::cluster_walktrap(g)$membership
out <- clusterPurity(sce, clusters)
boxplot(split(out$purity, clusters))
# Mocking up a stronger example:
ngenes <- 1000
centers <- matrix(rnorm(ngenes*3), ncol=3)
clusters <- sample(1:3, ncol(sce), replace=TRUE)
y <- centers[,clusters]
y <- y + rnorm(length(y))
out2 <- clusterPurity(y, clusters)
boxplot(split(out2$purity, clusters))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.