generate_kmeans_cluster_list: Obtain a list of clusters with their elements from data...

View source: R/find_central_clone.R

generate_kmeans_cluster_listR Documentation

Obtain a list of clusters with their elements from data matrix sent

Description

Runs kmeans method requesting each number of clusters from min_clusters:max_clusters

Compare each pair of rows in the feature_df using Morisita Horn method and return a correlation matrix ( as data.frame )

Usage

generate_kmeans_cluster_list(
  elements_df,
  cluster_id_width = NA,
  max_clusters = nrow(elements_df) - 1,
  min_clusters = 2,
  my_seed = NA
)

Arguments

elements_df

Data.frame or matrix of data to be clustered as samples x elements ( i.e. features )

cluster_id_width

The number of characters to include in cluster group and individual cluster id's ( will be used to left-pad cluster numbers with leading 0's )

max_clusters

Integer number representing largest number of clusters to split data into. Must be less than number of rows in matrix.

min_clusters

Integer number representing smallest number of clusters to split data into

my_seed

The seed key to use before each call to kmeans method so each run can be reproduced

feature_df

Data.frame with rows to be compared pair-wise

my_threads

Integer number representing the number of parallel processes to use for mhorn calculations

Value

Returns lists of clusters named as cluster_#clusters-in-run_cluster#-from-run = c(cluster_variable_names). Element names in clusters are sorted alphabetically.

Returns a correlation matrix in data.frame format


Benjamin-Vincent-Lab/binfotron documentation built on Oct. 1, 2024, 8:33 p.m.