CalculateMedianClusterSize | R Documentation |
This function calculates and returns the median size of clusters for a given assay and resolution in a Seurat object. It provides an option to display the median size via message.
CalculateMedianClusterSize(
obj,
assay = NULL,
res = NULL,
suffix = "_snn_res.",
columnName = NULL,
q = 0.5,
verbose = TRUE
)
obj |
A Seurat object containing metadata with clustering information. |
assay |
The name of the assay to which the resolution parameter is applied. |
res |
The resolution level for which to calculate the median cluster size. |
suffix |
String suffix for clustering name |
columnName |
Directly provide a meta.data column name instead of parsing it. |
q |
quantile. Default: 0.5, i.e: the median. |
verbose |
Logical; if TRUE, prints the median cluster size to the console. Defaults to TRUE. |
The function generates a column name based on the assay and resolution parameters, checks for the existence of this column in the object's metadata, calculates the median size of the clusters, and optionally outputs this information as a message.
The median size of the clusters at the specified resolution.
# Assuming `seuratObj` is a Seurat object with appropriate metadata
medianSize <- CalculateMedianClusterSize(obj = seuratObj, assay = "RNA", res = 0.8)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.