Hierarchical clustering on cell types from pseudobulk
Source:R/buildClusterTreeFromPB.R
buildClusterTreeFromPB.Rd
Perform hierarchical clustering on cell types from pseudobulk by aggregating read counts from each cell type.
Usage
buildClusterTreeFromPB(
pb,
method = c("complete", "ward.D", "single", "average", "mcquitty", "median", "centroid",
"ward.D2"),
dist.method = c("euclidean", "maximum", "manhattan", "canberra", "binary", "minkowski"),
assays = assayNames(pb)
)
Examples
library(muscat)
library(SingleCellExperiment)
data(example_sce)
# create pseudobulk for each sample and cell cluster
pb <- aggregateToPseudoBulk(example_sce,
assay = "counts",
cluster_id = "cluster_id",
sample_id = "sample_id",
verbose = FALSE
)
# Hierarchical clustering of cell types
hcl <- buildClusterTreeFromPB(pb)
plot(hcl)