buildClusterTreeFromPB: Hierarchical clustering on cell types from pseudobulk

View source: R/buildClusterTreeFromPB.R

buildClusterTreeFromPBR Documentation

Hierarchical clustering on cell types from pseudobulk

Description

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)
)

Arguments

pb

SingleCellObject storing pseudobulk for each cell type in in assay() field

method

clustering method for hclust()

dist.method

distance metric

assays

which assays to include

Value

hierarchical clustering object of class hclust

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)


GabrielHoffman/dreamlet documentation built on Nov. 8, 2024, 2:45 a.m.