Skip to contents

Merge initial clusters based on a provided similarity matrix and hierarchical clustering.

Usage

mergeInitialClusters(
  seu_list,
  dist_list,
  use = "coef",
  method = "hc",
  hc.method = "average",
  cutree.by = "h",
  cutree.h = 0.6,
  cutree.k = 3,
  batch.var = "Batch"
)

Arguments

seu_list

A list of Seurat objects containing the single-cell data. This parameter is required.

dist_list

A list of similarity matrices as returned by getDistMat(). The order of matrices should correspond to that of the Seurat objects in seu_list.

use

A string specifying the similarity measure to use. Currently, only "coef" is supported. Default is "coef".

method

A string specifying the clustering method to employ. The default is "hc" for hierarchical clustering.

hc.method

A string passed to the method parameter of hclust(). Default is "average".

cutree.by

A character indicating whether to cut the dendrogram by height ("h", default) or by a set number of clusters ("k").

cutree.h

A numeric value defining the height at which to cut the tree if cutree.by = "h". Default is 0.6.

cutree.k

A numeric value specifying the number of clusters to generate if cutree.by = "k". Default is 3.

batch.var

A character string representing the metadata column name that contains batch information. Default is "Batch".

Value

A list of Seurat objects in which the initial clustering has been updated. The new cluster assignments are stored in the inicluster field of each Seurat object, whilst the original assignments are preserved in the inicluster_tmp field.

Details

This function accepts a list of Seurat objects and a corresponding list of similarity matrices, and then merges the initial clusters using a hierarchical clustering approach. The updated cluster assignments are stored within each Seurat object.