plotBarplot: Barplot of 1 or 2 clusterings

Description Usage Arguments Details Author(s) Examples

Description

Make a barplot of sample's assignments to clusters for single clustering, or cross comparison for two clusterings.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## S4 method for signature 'ClusterExperiment,character'
plotBarplot(clusters, whichClusters,
  ...)

## S4 method for signature 'ClusterExperiment,missing'
plotBarplot(clusters, whichClusters, ...)

## S4 method for signature 'ClusterExperiment,numeric'
plotBarplot(clusters, whichClusters,
  labels = c("names", "ids"), ...)

## S4 method for signature 'ClusterExperiment,missing'
plotBarplot(clusters, whichClusters, ...)

## S4 method for signature 'vector,missing'
plotBarplot(clusters, whichClusters, ...)

## S4 method for signature 'matrix,missing'
plotBarplot(clusters, whichClusters, xNames = NULL,
  legNames = NULL, legend = TRUE, xlab = NULL, legend.title = NULL,
  unassignedColor = "white", missingColor = "grey",
  colPalette = bigPalette, ...)

Arguments

clusters

A matrix of with each column corresponding to a clustering and each row a sample or a ClusterExperiment object.

whichClusters

If numeric, a predefined order for the clusterings in the plot. If x is a ClusterExperiment object, whichClusters can be a character value identifying the clusterTypes to be used, or if not matching clusterTypes then clusterLabels; alternatively whichClusters can be either 'all' or 'workflow' to indicate choosing all clusters or choosing all workflowClusters.

...

for plotBarplot arguments passed either to the method of plotBarplot for matrices or ultimately to barplot.

labels

if clusters is a clusterExperiment object, then labels defines whether the clusters will be identified by their names values in clusterLegend (labels="names", the default) or by their clusterIds value in clusterLegend (labels="ids").

xNames

names for the first clusters (on x-axis). By default uses values in 1st cluster of clusters matrix

legNames

names for the first clusters (in legend). By default uses values in 2nd cluster of clusters matrix

legend

whether to plot the legend

xlab

label for x-axis. By default or if equal NULL the column name of the 1st cluster of clusters matrix

legend.title

label for legend. By default or if equal NULL the column name of the 2st cluster of clusters matrix

unassignedColor

If “-1” in clusters, will be given this color (meant for samples not assigned to cluster).

missingColor

If “-2” in clusters, will be given this color (meant for samples that were missing from the clustering, mainly when comparing clusterings run on different sets of samples)

colPalette

a vector of colors used for the different clusters. Must be as long as the maximum number of clusters found in any single clustering/column given in clusters or will otherwise return an error.

Details

The first column of the cluster matrix will be on the x-axis and the second column will separate the groups of the first column.

All arguments of the matrix version can be passed to the ClusterExperiment version. As noted above, however, some arguments have different interpretations.

If whichClusters = "workflow", then the most recent two clusters of the workflow will be chosen where recent is based on the following order (most recent first): final, mergeClusters, combineMany, clusterMany.

Author(s)

Elizabeth Purdom

Examples

1
2
3
4
5
6
7
8
9
#clustering using pam: try using different dimensions of pca and different k
data(simData)

cl <- clusterMany(simData, nPCADims=c(5, 10, 50), dimReduce="PCA",
clusterFunction="pam", ks=2:4, findBestK=c(TRUE,FALSE),
removeSil=c(TRUE,FALSE))

plotBarplot(cl)
plotBarplot(cl,whichClusters=1:2)

Bioconductor-mirror/clusterExperiment documentation built on Aug. 2, 2017, 4:28 p.m.