plotReducedDims {clusterExperiment} | R Documentation |
Plot a 2-dimensional representation of the data, color-code by a clustering.
## S4 method for signature 'ClusterExperiment,character' plotReducedDims(object, whichCluster, ...) ## S4 method for signature 'ClusterExperiment,missing' plotReducedDims(object, whichCluster, ...) ## S4 method for signature 'ClusterExperiment,numeric' plotReducedDims(object, whichCluster, reducedDim = "PCA", whichDims = c(1:2), plotUnassigned = TRUE, legend = TRUE, legendTitle = "", clusterLegend = NULL, unassignedColor = NULL, missingColor = NULL, pch = 19, xlab = NULL, ylab = NULL, ...)
object |
a ClusterExperiment object |
whichCluster |
which clusters to show on the plot |
... |
arguments passed to |
reducedDim |
What dimensionality reduction method to use. Should match
either a value in |
whichDims |
vector of length 2 giving the indices of which dimensions to show. The first value goes on the x-axis and the second on the y-axis. |
plotUnassigned |
logical as to whether unassigned (either -1 or -2 cluster values) should be plotted. |
legend |
either logical, indicating whether to plot legend, or character
giving the location of the legend (passed to |
legendTitle |
character value giving title for the legend. If NULL, uses the clusterLabels value for clustering. |
clusterLegend |
matrix with three columns and colnames
'clusterIds','name', and 'color' that give the color and name of the
clusters in whichCluster. If NULL, pulls the information from
|
unassignedColor |
If not NULL, should be character value giving the
color for unassigned (-2) samples (overrides |
missingColor |
If not NULL, should be character value giving the color
for missing (-2) samples (overrides |
pch |
the point type, passed to |
xlab |
Label for x axis |
ylab |
Label for y axis |
If plotUnassigned=TRUE
, and the color for -1 or -2 is set to
"white", will be coerced to "lightgrey" regardless of user input to
missingColor
and unassignedColor
. If plotUnassigned=FALSE
,
the samples with -1/-2 will not be plotted, nor will the category show up in the
legend.
A plot is created. Nothing is returned.
plot.default
, makeReducedDims
, listBuiltInReducedDims()
#clustering using pam: try using different dimensions of pca and different k data(simData) cl <- clusterMany(simData, nReducedDims=c(5, 10, 50), reducedDim="PCA", clusterFunction="pam", ks=2:4, findBestK=c(TRUE,FALSE), removeSil=c(TRUE,FALSE)) plotReducedDims(cl,legend="bottomright")