ComplexHeatmapPlot-class {iSEE} | R Documentation |
The ComplexHeatmapPlot is a panel class for creating a Panel that displays an assay of a SummarizedExperiment object as a Heatmap
with features as rows and samples and columns, respectively.
It provides slots and methods for specifying which assay to display in the main heatmap, and which metadata variables to display as row and column heatmap annotations.
The following slots control the assay that is used:
Assay
, string specifying the name of the assay to use for obtaining expression values.
Defaults to the first valid assay name (see ?".refineParameters,ComplexHeatmapPlot-method"
for details).
CustomRows
, a logical scalar indicating whether the custom list of features should be used.
If FALSE
, the incoming selection is used instead. Defaults to TRUE
.
CustomRowsText
, string specifying a custom list of features to use, as newline-separated row names.
If NA
, defaults to the first row name of the SummarizedExperiment object.
The following slots control the metadata variables that are used:
ColumnData
, a character vector specifying columns of the colData
to show as columnAnnotation
.
Defaults to character(0)
.
RowData
, a character vector specifying columns of the rowData
to show as columnAnnotation
.
Defaults to character(0)
.
The following slots control the clustering of features:
ClusterRows
, a logical scalar indicating whether features should be clustered by assay data.
Defaults to FALSE
.
ClusterRowsDistance
, string specifying a distance measure to use.
This can be any one of "euclidean"
, "maximum"
, "manhattan"
, "canberra"
, "binary"
, "minkowski"
, "pearson"
, "spearman"
, or "kendall"
.
Defaults to "spearman"
.
ClusterRowsMethod
, string specifying a linkage method to use.
This can be any one of "ward.D"
, "ward.D2"
, "single"
, "complete"
, "average"
, "mcquitty"
, "median"
, or "centroid"
.
Defaults to "ward.D2"
.
The following slots refer to general plotting parameters:
ShowDimNames
, a character vector specifying the dimensions for which to display names.
This can contain zero or more of "Rows"
and "Columns"
.
Defaults to "Rows"
.
LegendPosition
, string specifying the position of the legend on the plot.
Defaults to "Bottom"
but can also be "Right"
.
LegendDirection
, string specifying the orientation of the legend on the plot for continuous covariates.
Defaults to "Horizontal"
but can also be "Vertical"
.
The following slots control the effect of the transmitted selection from another panel:
SelectionEffect
, a string specifying the selection effect.
This should be one of "Color"
(the default), where all selected points change to the specified color;
"Restrict"
, where all non-selected points are not plotted.
SelectionColor
, a string specifying the color to use for selected points when SelectionEffect="Color"
.
Defaults to "red"
.
The following slots control some aspects of the user interface:
DataBoxOpen
, a logical scalar indicating whether the data parameter box should be open.
Defaults to FALSE
.
VisualBoxOpen
, a logical scalar indicating whether the visual parameter box should be open.
Defaults to FALSE
.
In addition, this class inherits all slots from its parent Panel class.
ComplexHeatmapPlot(...)
creates an instance of a ComplexHeatmapPlot 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 ComplexHeatmapPlot 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 NA
values in "Assay"
with the first valid assay name; and NA
values in CustomRowsText
with the first row name.
This will also call the equivalent Panel method for further refinements to x
.
If no valid column metadata fields 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 Panel method.
For defining the panel name:
.fullName(x)
will return "Complex heatmap"
.
Kevin Rue-Albrecht
Panel, for the immediate parent class.
################# # For end-users # ################# x <- ComplexHeatmapPlot() x[["ShowDimNames"]] x[["ShowDimNames"]] <- c("Rows", "Columns") ################## # For developers # ################## library(scater) sce <- mockSCE() sce <- logNormCounts(sce) old_cd <- colData(sce) colData(sce) <- NULL # Spits out a NULL and a warning if there is nothing to plot. sce0 <- .cacheCommonInfo(x, sce) .refineParameters(x, sce0) # Replaces the default with something sensible. colData(sce) <- old_cd sce0 <- .cacheCommonInfo(x, sce) .refineParameters(x, sce0)