Skip to contents

A function generating the elbow plot for the optimal number of clusters returned by the estimateNumcluster() function Methods available are: Gap, Silhouette, Slope, Jump, and Within Cluster Distance(WCD)

Usage

optiPlot(data, method = "jump")

Arguments

data

a Self Organizing Map object generated by generatePrototypes(), or an object of class SingleCellExperiment or SpatialExperiment

method

one of 'jump', 'slope', 'wcd', 'gap', or 'silhouette'

Value

an elbow plot object where the optimal number of clusters is marked

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
resEstK <- estimateNumCluster(res$model, kSeq = 2:25)
#> Now Computing the Number of Clusters using Discriminant Analysis
#> Now Computing The Number Of Clusters Using Distance Analysis
p <- optiPlot(resEstK, method = "jump")