Skip to contents

A function for estimating the number of clusters using various method Methods available are: Discriminant, Distance (Gap, Silhouette, Slope, Jump, and Within Cluster Distance,) and Instability

Usage

estimateNumCluster(data, method = c("Discriminant", "Distance"), kSeq = 2:20)

Arguments

data

the SOM object generated by generatePrototypes(), or an object of class SingleCellExperiment or SpatialExperiment.

method

one of Discriminant, Distance, Stability. By default, everything is run

kSeq

a sequence of the number of clusters to try. Default is 2:20 clusters

Value

A list containing the cluster estimations if a dataframe or matrix is provided

A SingleCellExperiment with a cluster estimate in it's metadata if a SingleCellExperiment or SpatialExperiment object is provided

Author

Elijah WIllie ewil3501@uni.sydney.edu.au

Examples

data("risom_dat")
risomMarkers <- c(
  "CD45", "SMA", "CK7", "CK5", "VIM", "CD31", "PanKRT", "ECAD"
)
res <- runFuseSOM(risom_dat, markers = risomMarkers, numClusters = 23)
#> You have provided a dataset of class data.frame
#> Everything looks good. Now running the FuseSOM algorithm
#> Now Generating the Self Organizing Map Grid
#> Optimal Grid Size is: 5
#> Now Running the Self Organizing Map Model
#> Now Clustering the Prototypes
#> Now Mapping Clusters to the Original Data
#> The Prototypes have been Clustered and Mapped Successfully
#> The FuseSOM algorithm has completed successfully
res.est.k <- estimateNumCluster(res$model, kSeq = 2:25)
#> Now Computing the Number of Clusters using Discriminant Analysis
#> Now Computing The Number Of Clusters Using Distance Analysis