Learn R Programming

IntClust (version 0.0.2)

ClusterPlot: Plot a dendrogram with leaves colored by a result of choice

Description

The above described function ClusterCols is used in the function Clusterplot which actually plots the dendrogram made by ClusterCols. Further, given the outputs of any other functions, it is capable of selecting the elements needed for ClusterCols.

Usage

ClusterPlot(Data1, Data2=NULL, nrclusters = NULL, cols = NULL,plottype="new",
location=NULL,ColorComps = NULL, ...)

Arguments

Data1

The resulting clustering of a method which contains the dendrogram to be colored.

Data2

Optional. The resulting clustering of another method , i.e. the resulting clustering on which the colors should be based.

nrclusters

Optional. The number of clusters to cut the dendrogram in. If not specified the dendrogram will be drawn without colors to discern the different clusters.

cols

The colors for the clusters if nrclusters is specified.

plottype

Should be one of "pdf","new" or "sweave". If "pdf", a location should be provided in "location" and the figure is saved there. If "new" a new graphic device is opened and if "sweave", the figure is made compatible to appear in a sweave or knitr document.

location

If plottype is "pdf", a location should be provided in "location" and the figure is saved there.

ColorComps

If only a specific set of compounds need to be highlighted, this can be specified here. The compounds should be given in a character vector. If specified, all other compound labels will be colored black.

Other options which can be given to the plot function.

Value

A plot of the dendrogram of the first clustering result with colored leaves. If a second clustering result is given in Data2, the colors are based on this clustering result.

Details

This function relies on the internal ClusterCols function.

Examples

Run this code
# NOT RUN {
data(fingerprintMat)
data(targetMat)
data(Colors1)

MCF7_T = Cluster(targetMat,type="data",distmeasure="tanimoto",normalize=FALSE,
method=NULL,clust="agnes",linkage="ward",gap=FALSE,maxK=55,StopRange=FALSE)

ClusterPlot(MCF7_T ,nrclusters=7,cols=Colors1,plottype="new",location=NULL,
main="Clustering on Target Predictions: Dendrogram",ylim=c(-0.1,1.8))
# }

Run the code above in your browser using DataLab