ReducedDimensionPlot-class: The ReducedDimensionPlot panel

ReducedDimensionPlot-classR Documentation

The ReducedDimensionPlot panel

Description

The ReducedDimensionPlot is a panel class for creating a ColumnDotPlot where the coordinates of each column/sample are taken from the reducedDims of a SingleCellExperiment object. It provides slots and methods to specify which dimensionality reduction result to use and to create the data.frame with the coordinates of the specified results for plotting.

ReducedDimensionPlot slot overview

The following slots control the dimensionality reduction result that is used:

  • Type, a string specifying the name of the dimensionality reduction result. If NA, defaults to the first entry of reducedDims.

  • XAxis, integer scalar specifying the dimension to plot on the x-axis. Defaults to 1.

  • YAxis, integer scalar specifying the dimension to plot on the y-axis. Defaults to 2.

In addition, this class inherits all slots from its parent ColumnDotPlot, DotPlot and Panel classes.

Constructor

ReducedDimensionPlot(...) creates an instance of a ReducedDimensionPlot class, where any slot and its value can be passed to ... as a named argument.

Supported methods

In the following code snippets, x is an instance of a ReducedDimensionPlot class. Refer to the documentation for each method for more details on the remaining arguments.

For setting up data values:

  • .cacheCommonInfo(x) adds a "ReducedDimensionPlot" entry containing valid.reducedDim.names, a character vector of names of valid dimensionality reduction results (i.e., at least one dimension). This will also call the equivalent ColumnDotPlot method.

  • .refineParameters(x, se) replaces NA values in RedDimType with the first valid dimensionality reduction result name in se. This will also call the equivalent ColumnDotPlot method for further refinements to x. If no dimensionality reduction results are available, NULL is returned instead.

For defining the interface:

  • .defineDataInterface(x, se, select_info) returns a list of interface elements for manipulating all slots described above.

  • .panelColor(x) will return the specified default color for this panel class.

For monitoring reactive expressions:

  • .createObservers(x, se, input, session, pObjects, rObjects) sets up observers for all slots described above and in the parent classes. This will also call the equivalent ColumnDotPlot method.

For defining the panel name:

  • .fullName(x) will return "Reduced dimension plot".

For creating the plot:

  • .generateDotPlotData(x, envir) will create a data.frame of reduced dimension coordinates in envir. It will return the commands required to do so as well as a list of labels.

For documentation:

  • .definePanelTour(x) returns an data.frame containing a panel-specific tour.

Subclasses do not have to provide any methods, as this is a concrete class.

Author(s)

Aaron Lun

See Also

ColumnDotPlot, for the immediate parent class.

Examples

#################
# For end-users #
#################

x <- ReducedDimensionPlot()
x[["Type"]]
x[["Type"]] <- "TSNE"

##################
# For developers #
##################

library(scater)
sce <- mockSCE()
sce <- logNormCounts(sce)

# Spits out a NULL and a warning if no reducedDims are available.
sce0 <- .cacheCommonInfo(x, sce)
.refineParameters(x, sce0)

# Replaces the default with something sensible.
sce <- runPCA(sce)
sce0 <- .cacheCommonInfo(x, sce)
.refineParameters(x, sce0)


iSEE/iSEE documentation built on April 5, 2024, 5:32 a.m.