cluster_counts: cluster counts matrix based using louvain clustering based on...

Description Usage Arguments Value

View source: R/cluster_counts.R

Description

cluster counts matrix based using louvain clustering based on UMAP and PCA

Usage

1
2
3
4
5
6
7
cluster_counts(
  counts,
  ids = NULL,
  pca.fraction = 0.8,
  umap.metric = "cosine",
  ...
)

Arguments

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

Value

list containing two elements:

  1. clustering - numeric clustering vector, contains clusters for all spots in the same order as rownames(counts)

  2. umap.plot - ggplot object, UMAP plot of count matrix coloured by clustering

  3. spatial.plot - ggplot object, spatial representation of clustering; only if parameter


tmirus/TTT documentation built on April 17, 2021, 11:04 p.m.