get_num_clust: Find optimal number of clusters

View source: R/cluster.R

get_num_clustR Documentation

Find optimal number of clusters

Description

This function uses the Silhouette Method applied to CNV scores to determine the best number of clusters to divide the binned beads into

Usage

get_num_clust(
  data,
  hc_func = "ward.D2",
  max_k = 10,
  plot = TRUE,
  malig = FALSE,
  k = NA,
  plot_directory
)

Arguments

data

cnv_data list object of cnv data from SlideCNA::prep_cnv_dat()

hc_func

character string for which hierarchical clustering function to use

max_k

integer of number max number of clusters to evaluate (2:max_k)

plot

TRUE if plotting silhoutte scores per cluster

malig

TRUE if only using malignant bins and FALSE if using all bins

k

integer of optimal number of clusters, if known, and NA if not known

plot_directory

output plot directory path

Value

An integer representing the number of clusters that optimizes the silhouette score


dkzhang777/SlideCNA documentation built on Jan. 25, 2025, 5:53 p.m.