plot_cluster {musicatk}R Documentation

Visualize clustering results

Description

The clustering results can be visualized on a UMAP panel. Three different types of plots can be generated using this function: cluster-by-signature plot, cluster-by-annotation plot, and a single UMAP plot.

Usage

plot_cluster(result, clusters, group = "signature", annotation = NULL)

Arguments

result

A musica_result object generated by a mutational discovery or prediction tool. A two-dimensional UMAP has to be stored in this object.

clusters

The result generated from cluster_exposure function.

group

A single character string indicating the grouping factor. Possible options are: "signature" (columns are signatures in a grid), "annotation" (columns are sample annotation), and "none" (a single UMAP plot). Default is "signature".

annotation

Column name of annotation.

Value

Generate a ggplot object.

See Also

create_umap

Examples

set.seed(123)
data(res_annot)
#Get clustering result
clust_out <- cluster_exposure(result = res_annot, nclust = 2)
#UMAP
create_umap(result = res_annot)
#generate cluster X signature plot
plot_cluster(result = res_annot, clusters = clust_out, group = "signature")
#generate cluster X annotation plot
plot_cluster(result = res_annot, clusters = clust_out, group = "annotation",
            annotation = "Tumor_Subtypes")
#generate a single UMAP plot
plot_cluster(result = res_annot, clusters = clust_out, group = "none")

[Package musicatk version 1.2.0 Index]