| Table-class {iSEE} | R Documentation |
The Table is a virtual class for all panels containing a datatable widget from the DT package, where each row usually corresponds to a row or column of the SummarizedExperiment object.
It provides observers for monitoring table selection, global search and column-specific search.
The following slots control aspects of the DT::datatable interface:
Selected, a string containing the name of the currently selected row of the data.frame.
Defaults to NA, in which case the value should be chosen by the subclass' .refineParameters method.
Search, a string containing the regular expression for the global search.
Defaults to "", i.e., no search.
SearchColumns, a character vector where each entry contains the search string for each column.
Defaults to an empty character vector, i.e., no search.
In addition, this class inherits all slots from its parent Panel class.
In the following code snippets, x is an instance of a Table class.
Refer to the documentation for each method for more details on the remaining arguments.
For defining the interface:
.defineOutput(x, id) returns a UI element for a dataTableOutput widget.
For defining reactive expressions:
.createObservers(x, se, input, session, pObjects, rObjects) sets up observers for all of the slots.
This will also call the equivalent Panel method.
.renderOutput(x, se, output, pObjects, rObjects) will add a rendered datatable object to output.
This will also call the equivalent Panel method to render the panel information testboxes.
.generateOutput(x, se, all_memory, all_contents) returns a list containing contents, a data.frame with one row per point currently present in the table;
and commands, a list of character vector containing the R commands required to generate contents and plot.
.exportOutput(x, se, all_memory, all_contents) will create a CSV file containing the current table, and return a string containing the path to that file.
This assumes that the contents field returned by .generateOutput is a data.frame or can be coerced into one.
For controlling selections:
.multiSelectionRestricted(x) returns TRUE.
Transmission of a selection to a Table will manifest as a subsetting of the rows.
.multiSelectionActive(x) returns a list containing the contents of x[["Search"]] and x[["ColumnSearch"]].
If both contain only empty strings, a NULL is returned instead.
.multiSelectionCommands(x, index) returns a character vector of R expressions that - when evaluated - return a character vector of the row names of the table after applying all search filters.
The value of index is ignored.
.singleSelectionValue(x, pObjects) returns the name of the row that was last selected in the datatable widget.
Unless explicitly specialized above, all methods from the parent class Panel are also available.
The Table is a rather vaguely defined class for which the only purpose is to avoid duplicating code for ColumnDotPlots and RowDotPlots. We recommend extending those subclasses instead.
Aaron Lun
Panel, for the immediate parent class.