Constructs a phylogenetic tree relating the 'aggregate' cell from each identity class. Tree is estimated based on a distance matrix constructed in either gene expression space or PCA space.
BuildClusterTree(
object,
assay = NULL,
features = NULL,
dims = NULL,
reduction = "pca",
graph = NULL,
slot = "data",
reorder = FALSE,
reorder.numeric = FALSE,
verbose = TRUE
)
Seurat object
Assay to use for the analysis.
Genes to use for the analysis. Default is the set of
variable genes (VariableFeatures(object = object)
)
If set, tree is calculated in dimension reduction space;
overrides features
Name of dimension reduction to use. Only used if dims
is not NULL.
If graph is passed, build tree based on graph connectivity between
clusters; overrides dims
and features
slot/layer to use.
Re-order identity classes (factor ordering), according to position on the tree. This groups similar classes together which can be helpful, for example, when drawing violin plots.
Re-order identity classes according to position on the tree, assigning a numeric value ('1' is the leftmost node)
Show progress updates
A Seurat object where the cluster tree can be accessed with Tool
Note that the tree is calculated for an 'aggregate' cell, so gene expression or PC scores are summed across all cells in an identity class before the tree is constructed.
if (FALSE) {
if (requireNamespace("ape", quietly = TRUE)) {
data("pbmc_small")
pbmc_small
pbmc_small <- BuildClusterTree(object = pbmc_small)
Tool(object = pbmc_small, slot = 'BuildClusterTree')
}
}