setup-generics {iSEE} | R Documentation |
These generics are related to the initial setup of the iSEE application.
In .cacheCommonInfo(x, se)
, the following arguments are required:
x
, an instance of a Panel class.
se
, the SummarizedExperiment object containing the current dataset.
It is expected to return se
with (optionally) extra fields added to metadata(se)$iSEE
.
Each field should be named according to the class name and contain some common information that is constant for all instances of the class of x
- see .setCachedCommonInfo
for an appropriate setter utility.
The goal is to avoid repeated recomputation of required values when creating user interface elements or observers.
Methods for this generic should start by checking whether the metadata already contains the class name, and returning se
without modification if this is the case.
Otherwise, it should callNextMethod
to fill in the cache values from the parent classes, before adding cached values under the class name for x
.
Remember, the cache is strictly for use in defining interface elements and in observers. Developers should not expect to be able to retrieve cached values when rendering the output for a panel, as the code tracker does not capture the code used to construct the cache.
In .refineParameters(x, se)
, the following arguments are required:
x
, an instance of a Panel class.
se
, the SummarizedExperiment object containing the current dataset.
Methods for this generic should return a copy of x
where slots with invalid values are replaced with appropriate entries from se
.
This is necessary because the constructor and validity methods for x
does not know about se
;
thus, certain slots (e.g., for the row/column names) cannot be set to a reasonable default or checked at that point.
We recommend specializing initialize
to fill any yet-to-be-determined slots with NA
defaults.
.refineParameters
can then be used to sweep across these slots and replace them with appropriate entries,
typically by using .getCachedCommonInfo
to extract previously cached valid values.
Of course, any slots that are not se
-dependent should be set at construction and checked by the validity method.
It is also possible for this generic to return NULL
, which is used as an indicator that se
does not contain information to meaningfully show any instance of the class of x
in the iSEE app.
For example, the method for ReducedDimensionPlot will return NULL
if se
is not a SingleCellExperiment containing some dimensionality reduction results.
Aaron Lun