Description Usage Arguments Value
View source: R/cluster_counts.R
cluster counts matrix based using louvain clustering based on UMAP and PCA
1 2 3 4 5 6 7 | cluster_counts(
counts,
ids = NULL,
pca.fraction = 0.8,
umap.metric = "cosine",
...
)
|
counts |
non-negative numeric matrix containing gene counts, rows correspond to spots, columns correspond to genes |
ids |
data frame or matrix assigning spatial coordinates to the spots, used for clustering in combination with the UMAP embedding, optional |
pca.fraction |
numeric, 0 < pca.fraction < 1. Fraction of variance to be explained by principal components taken into account. default 0.8 |
umap.metric |
string, metric passed to uwot::umap for umap embedding. default 'cosine' |
..., |
parameters passed to uwot::umap function for fine-tuning |
list containing two elements:
clustering - numeric clustering vector, contains clusters for all spots in the same order as rownames(counts)
umap.plot - ggplot object, UMAP plot of count matrix coloured by clustering
spatial.plot - ggplot object, spatial representation of clustering; only if parameter
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.