draw.MICA: Draw Cluster Plot Using MICA (cluster algorithm)

View source: R/pipeline_functions.R

draw.MICAR Documentation

Draw Cluster Plot Using MICA (cluster algorithm)

Description

draw.MICA is a function to visualize the cluster result for the samples using MICA (mutual information based clustering analysis) algorithm. Users need to give the MICA project information (directory and name), and the samples real labels. MICA returns the K-value that yields the best clustering performance. Users can pick one comparison score to show in the plot, "ARI", "NMI" or "Jaccard". MICA is not suggested, when sample size is small. This function may not work well for the updated version of MICA.

Usage

draw.MICA(
  outdir = NULL,
  prjname = NULL,
  all_k = NULL,
  obs_label = NULL,
  legend_pos = "topleft",
  legend_cex = 0.8,
  point_cex = 1,
  plot_type = "2D.ellipse",
  choose_k_strategy = "ARI",
  visualization_type = "tsne",
  return_type = "optimal",
  main = "",
  verbose = TRUE,
  use_color = NULL,
  pre_define = NULL
)

Arguments

outdir

character, the output directory for running MICA.

prjname

charater, the project name for running MICA.

all_k

a vector of integers, the pre-defined K-values. If NULL, will use all possible K. Default is NULL.

obs_label

a vector of characters, the observed sample labels or categories.

legend_pos

character, position of the legend in the plot. Default is "topleft".

legend_cex

numeric, giving the amount by which the text of legend should be magnified relative to the default. Default is 0.8.

point_cex

numeric, giving the amount by which the size of the data points should be magnified relative to the default. Default is 1.

plot_type

character, type of the plot. Users can choose from "2D", "2D.ellipse", "2D.text" and "3D". Default is "2D.ellipse".

choose_k_strategy

character, method to choose the K-value. Users can choose from "ARI (adjusted rand index)", "NMI (normalized mutual information)" and "Jaccard". Default is "ARI".

visualization_type

character, users can choose from "tsne", "umap" and "mds". Default is "tsne".

return_type

character, the type of result returned. Users can choose "optimal" or "all". "all", all the K-values in all_k will be returned. "optimal", only the K-value yielding the optimal classification result will be returned. Default is "optimal".

main

character, title for the plot.

verbose

logical, if TRUE, print out detailed information during calculation. Default is TRUE.

use_color

a vector of color codes, colors to be assigned to each member of display label. Default is brewer.pal(9, 'Set1').

pre_define

a vector of characters, pre-defined color codes for a certain input (e.g. c("blue", "red") with names c("A", "B")). Default is NULL.

Value

Return a vector of the predicted label (if return_type is "optimal") and a list of all possible K- values (if return_type is "all").


jyyulab/NetBID documentation built on Dec. 23, 2024, 6:34 a.m.