Description Slot overview Constructor Supported methods Author(s) See Also Examples
The FeatureAssayPlot is a panel class for creating a ColumnDotPlot where the y-axis represents the expression of a feature of interest, using the assay
values of the SummarizedExperiment.
It provides slots and methods to specify the feature and what to plot on the x-axis, as well as a method to actually create a data.frame containing those pieces of data in preparation for plotting.
The following slots control the values on the y-axis:
YAxisFeatureName
, a string specifying the name of the feature to plot on the y-axis.
If NA
, defaults to the first row name of the SummarizedExperiment object.
Assay
, string specifying the name of the assay to use for obtaining expression values.
Defaults to the first valid assay name (see ?".refineParameters,DotPlot-method"
for details).
YAxisFeatureSource
, string specifying the encoded name of the transmitting panel to obtain a single selection that replaces YAxisFeatureName
.
Defaults to "---"
, i.e., no transmission is performed.
YAxisFeatureDynamicSource
, a logical scalar indicating whether x
should dynamically change its selection source for the y-axis.
Defaults to FALSE
.
The following slots control the values on the x-axis:
XAxis
, string specifying what should be plotting on the x-axis.
This can be any one of "None"
, "Feature name"
or "Column data"
.
Defaults to "None"
.
XAxisColumnData
, string specifying which column of the colData
should be shown on the x-axis,
if XAxis="Column data"
.
Defaults to the first valid colData
field (see ?".refineParameters,ColumnDotPlot-method"
for details).
XAaxisFeatureName
, string specifying the name of the feature to plot on the x-axis,
if XAxis="Feature name"
.
Defaults to the first row name.
XAxisFeatureSource
, string specifying the encoded name of the transmitting panel to obtain a single selection that replaces XAxisFeatureName
.
Defaults to "---"
, i.e., no transmission is performed.
XAxisFeatureDynamicSource
, a logical scalar indicating whether x
should dynamically change its selection source for the x-axis.
Defaults to FALSE
.
In addition, this class inherits all slots from its parent ColumnDotPlot, DotPlot and Panel classes.
FeatureAssayPlot(...)
creates an instance of a FeatureAssayPlot 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 FeatureAssayPlot class.
Refer to the documentation for each method for more details on the remaining arguments.
For setting up data values:
.refineParameters(x, se)
replaces any NA
values in XAxisFeatureName
and YAxisFeatureName
with the first row name; any NA
value in Assay
with the first valid assay name; and any NA
value in XAxisColumnData
with the first valid column metadata field.
This will also call the equivalent ColumnDotPlot method for further refinements to x
.
If no rows or assays are present, 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 "Feature assay plot"
.
For creating the plot:
.generateDotPlotData(x, envir)
will create a data.frame of feature expression values in envir
.
It will return the commands required to do so as well as a list of labels.
For managing selections:
.singleSelectionSlots(x)
will return a list specifying the slots that can be updated by single selections in transmitter panels, mostly related to the choice of feature on the x- and y-axes.
This includes the output of callNextMethod
.
For documentation:
.definePanelTour(x)
returns an data.frame containing a panel-specific tour.
Aaron Lun
ColumnDotPlot, 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 25 26 27 28 | #################
# For end-users #
#################
x <- FeatureAssayPlot()
x[["XAxis"]]
x[["Assay"]] <- "logcounts"
x[["XAxisColumnData"]] <- "stuff"
##################
# For developers #
##################
library(scater)
sce <- mockSCE()
sce <- logNormCounts(sce)
old_assay_names <- assayNames(sce)
assayNames(sce) <- character(length(old_assay_names))
# Spits out a NULL and a warning if no assays are named.
sce0 <- .cacheCommonInfo(x, sce)
.refineParameters(x, sce0)
# Replaces the default with something sensible.
assayNames(sce) <- old_assay_names
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.