Visulize clusters after using the cluster algorithms implemented in the functions. This cluster plot make use of the function dapc from package adegenet and function scatter.dapc from package adegenet. The plot is based on observation assignment and discriminant analysis of principal components, therefore, when running the code, it will asks you to choose the number of PCs and the number of discriminant functions to retain.

plot_cluster(res, xax = 1, yax = 2, isGene = FALSE)

Arguments

res

Results returned from kmodes or khaplotype.

xax

Integer specifying which principal components should be shown in x axes, default is 1.

yax

Integer specifying which principal components should be shown in y axes, default is 2. Notice both xax and yax should be at least smaller than the number of discriminant functions choosed.

isGene

Indicate if the clustering data is gene sequences, default if FALSE.

Value

A plot reflecting clustering results.

Examples

# use function \code{kmodes} if (FALSE) { data <- system.file("extdata", "zoo.int.data", package = "CClust") res_kmodes <- kmodes(K = 5, datafile = data, algorithm = "KMODES_HARTIGAN_WONG", init_method = "KMODES_INIT_AV07_GREEDY", n_init = 10) plot_cluster(res_kmodes) #Plot the clusters by using other principle components. plot_cluster(res_kmodes, xax = 2, yax = 3) } # use function \code{khaplotype} if (FALSE) { data <- system.file("extdata", "sim_small.fastq", package = "CClust") res_khap <- khaplotype(K = 5, datafile = data, n_init = 10) plot_cluster(res_khap, isGene = TRUE) }