Description Slot overview Constructor Supported methods Subclass expectations Author(s) See Also Examples
The RowDataPlot is a panel class for creating a RowDotPlot where the y-axis represents a variable from the rowData
of a SummarizedExperiment object.
It provides slots and methods for specifying which variable to use on the y-axis (and, optionally, also the x-axis), as well as a method to create the data.frame in preparation for plotting.
The following slots control the variables to be shown:
YAxis
, a string specifying the row of the rowData
to show on the y-axis.
If NA
, defaults to the first valid field (see ?".refineParameters,RowDotPlot-method"
).
XAxis
, string specifying what should be plotting on the x-axis.
This can be any one of "None"
or "Row data"
.
Defaults to "None"
.
XAxisRowData
, string specifying the row of the rowData
to show on the x-axis.
If NA
, defaults to the first valid field.
In addition, this class inherits all slots from its parent RowDotPlot, DotPlot and Panel classes.
RowDataPlot(...)
creates an instance of a RowDataPlot class, where any slot and its value can be passed to ...
as a named argument.
In the following code snippets, x
is an instance of a RowDataPlot class.
Refer to the documentation for each method for more details on the remaining arguments.
For setting up data values:
.refineParameters(x, se)
returns x
after replacing any NA
value in YAxis
or XAxisRowData
with the name of the first valid rowData
variable.
This will also call the equivalent RowDotPlot method for further refinements to x
.
If no valid row metadata variables 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.
.allowableXAxisChoices(x, se)
returns a character vector specifying the acceptable variables in rowData(se)
that can be used as choices for the x-axis.
This consists of all variables with atomic values.
.allowableYAxisChoices(x, se)
returns a character vector specifying the acceptable variables in rowData(se)
that can be used as choices for the y-axis.
This consists of all variables with atomic values.
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 RowDotPlot method.
For defining the panel name:
.fullName(x)
will return "Row data plot"
.
For creating the plot:
.generateDotPlotData(x, envir)
will create a data.frame of row metadata variables 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.
Aaron Lun
RowDotPlot, for the immediate parent class.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | #################
# For end-users #
#################
x <- RowDataPlot()
x[["XAxis"]]
x[["XAxis"]] <- "Row data"
##################
# For developers #
##################
library(scater)
sce <- mockSCE()
sce <- logNormCounts(sce)
# Spits out a NULL and a warning if is nothing to plot.
sce0 <- .cacheCommonInfo(x, sce)
.refineParameters(x, sce0)
# Replaces the default with something sensible.
rowData(sce)$Stuff <- runif(nrow(sce))
sce0 <- .cacheCommonInfo(x, sce)
.refineParameters(x, sce0)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.