plotFeatureScatter: Plot scatter plot of feature values colored by cluster

plotFeatureScatterR Documentation

Plot scatter plot of feature values colored by cluster

Description

Plot a scatter plot of the (transformed) values for a set of gene expression values, colored by cluster

Usage

## S4 method for signature 'ClusterExperiment,character'
plotFeatureScatter(object, features, ...)

## S4 method for signature 'ClusterExperiment,numeric'
plotFeatureScatter(
  object,
  features,
  whichCluster = "primary",
  plotUnassigned = TRUE,
  unassignedColor = "grey",
  missingColor = "white",
  whichAssay = 1,
  legendLocation = NA,
  jitterFactor = NA,
  ...
)

Arguments

object

a ClusterExperiment object

features

the indices of the features (either numeric or character matching rownames of object) to be plotted.

...

arguments passed to boxplot

whichCluster

argument that can be a single numeric or character value indicating the single clustering to be used. Giving values that result in more than one clustering will result in an error. See details of getClusterIndex.

plotUnassigned

whether to plot the unassigned samples as a cluster (either -1 or -2)

unassignedColor

If not NULL, should be character value giving the color for unassigned (-2) samples (overrides clusterLegend) default.

missingColor

If not NULL, should be character value giving the color for missing (-2) samples (overrides clusterLegend) default.

whichAssay

numeric or character specifying which assay to use. See assay for details.

legendLocation

character value passed to location argument of plotClusterLegend indicating where to put the legend. If NA, legend will not be plotted.

jitterFactor

numeric. If NA, no jittering is done. Otherwise, passed to factor of function jitter (useful for low counts)

Value

returns invisibly the results of pairs or plot command.

Examples

data(simData)
#Create a ClusterExperiment object
cl <- clusterMany(simData, nReducedDims=c(5, 10, 50), reducedDim="PCA",
   clusterFunction="pam", ks=2:4, findBestK=c(TRUE,FALSE),
   removeSil=c(TRUE,FALSE), makeMissingDiss=TRUE)
#give names to the clusters
cl<-renameClusters(cl, whichCluster=1, 
   value=letters[1:nClusters(cl)[1]])
plotFeatureScatter(cl,feature=1:2,pch=19,legendLocation="topright")

epurdom/clusterExperiment documentation built on April 28, 2024, 8:17 p.m.