visualizeSampleClustering: Interactive figure with 2D scatter-plot

View source: R/sampleView.R

visualizeSampleClusteringR Documentation

Interactive figure with 2D scatter-plot

Description

Open an interactive figure with 2D scatter-plot of all particles with axis choice. Grey color (label=0) is for data to cleaned or to remove in classification process.

Usage

visualizeSampleClustering(
  data.sample,
  label = NULL,
  clustering.name = "proposed clustering",
  cluster.summary = NULL,
  RclusTool.env = initParameters(),
  prototypes = NULL,
  profile.mode = "none",
  selection.mode = "none",
  compare.mode = "off",
  pairs = NULL,
  features.mode = "initial",
  wait.close = FALSE,
  fontsize = 9
)

Arguments

data.sample

list containing features, profiles and clustering results.

label

vector of labels.

clustering.name

character vector specifying the clustering method used to get labels.

cluster.summary

data.frame containing the clusters summaries (as returned by 'clusterSummary').

RclusTool.env

environment in which all global parameters, raw data and results are stored.

prototypes

list containing vectors of prototypes indices.

profile.mode

character vector specifying the plot mode of profiles. Must be 'none' (default), 'whole sample', 'cluster i' or 'constrained pairs'.

selection.mode

character vector specifying the selection mode of profiles. Must be 'none' (default), 'prototypes' or 'pairs'.

compare.mode

character vector specifying the mode of comparison between two clusterings results. Must be 'off' (default) or 'on'.

pairs

list of constrained pairs (must-link and cannot-link).

features.mode

character vector specifying the plot mode of features (projection in a specific space). Must be 'initial' (default), 'preprocessed', 'pca', 'pca_full' or 'spectral', or prefixed versions ('sampled', 'scaled') of those space names.

wait.close

boolean: if FALSE (default), the following steps of the analysis calculations are computed even if the window is not closed.

fontsize

size of font (default is 9)

Details

visualizeSampleClustering opens an interactive figure with 2D scatter-plot of all particles with axis choice

Value

prototypes in selection.mode = "prototypes" mode, pairs in selection.mode = "pairs" mode.

See Also

plotProfile, plotSampleFeatures

Examples

dat <- rbind(matrix(rnorm(100, mean = 2, sd = 0.3), ncol = 2), 
             matrix(rnorm(100, mean = 4, sd = 0.3), ncol = 2), 
             matrix(rnorm(100, mean = 6, sd = 0.3), ncol = 2))
colnames(dat) <- c("x","y")
tf1 <- tempfile()
write.table(dat, tf1, sep=",", dec=".")

sig <- data.frame(ID=rep(1:150, each=30), SIGNAL=rep(dnorm(seq(-2,2,length=30)),150))
tf2 <- tempfile()
write.table(sig, tf2, sep=",", dec=".")

x <- importSample(file.features=tf1, file.profiles=tf2)

res <- KmeansQuick(x$features$initial$x, K=3)
new.labels <- formatLabelSample(res$cluster, x)

visualizeSampleClustering(x, label = new.labels, clustering.name="K-means", 
		     profile.mode="whole sample")
 

RclusTool documentation built on May 29, 2024, 5:23 a.m.