VolcanoPlot-class {iSEEu} | R Documentation |
The VolcanoPlot is a RowDataPlot subclass that is dedicated to creating a volcano plot.
It retrieves the log-fold change and p-value from and creates a row-based plot where each point represents a feature.
Users are expected to load relevant statistics into the rowData
of a SummarizedExperiment.
The following slots control the thresholds used in the visualization:
PValueThreshold
, a numeric scalar in (0, 1] specifying the threshold to use on the (adjusted) p-value.
Defaults to 0.05.
LogFCThreshold
, a non-negative numeric scalar specifying the threshold to use on the log-fold change.
Defaults to 0.
PValueCorrection
, a string specifying the multiple testing correction to apply.
Defaults to "BH"
, but can take any value from p.adjust.methods
.
In addition, this class inherits all slots from its parent RowDataPlot, RowDotPlot, DotPlot and Panel classes.
VolcanoPlot(...)
creates an instance of a VolcanoPlot 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:
.cacheCommonInfo(x)
adds a "MAPlot"
entry containing pval.rowData.names
and lfc.rowData.names
.
Each of these is a character vector of permissible names for p-values and log-fold changes, respectively;
see ?.getAcceptablePValueFields
for details.
This will also call the equivalent RowDataPlot method.
.refineParameters(x, se)
returns x
after setting XAxis="Row data"
.
This will also call the equivalent RowDataPlot method for further refinements to x
.
If valid p-value and log-fold change fields are not 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 log-fold change-related variables in rowData(se)
that can be used as choices for the x-axis, see ?.getAcceptableLogFCFields
.
.allowableYAxisChoices(x, se)
returns a character vector specifying the acceptable p-value-related variables in rowData(se)
that can be used as choices for the y-axis, see ?.getAcceptablePValueFields
.
.hideInterface(x, field)
will return TRUE
for field="XAxis"
,
otherwise it will call the RowDataPlot method.
.fullName(x)
will return "Volcano plot"
.
For monitoring reactive expressions:
.createObservers(x, se, input, session, pObjects, rObjects)
sets up observers for all new slots described above, as well as in the parent classes via the RowDataPlot method.
For creating the plot:
.generateDotPlotData(x, envir)
will create a data.frame of row metadata variables in envir
.
This should contain negative log-transformed p-values on the y-axis and log-fold changes on the x-axis,
in addition to an extra field specifying whether or not the feature was considered to be significantly up or down.
The method will return the commands required to do so as well as a list of labels.
.prioritizeDotPlotData(x, envir)
will create variables in envir
marking the priority of points.
Significant features receive higher priority (i.e., are plotted over their non-significant counterparts) and are less aggressively downsampled when Downsample=TRUE
.
The method will return the commands required to do this as well as a logical scalar indicating that rescaling of downsampling resolution is performed.
.colorByNoneDotPlotField(x)
will return a string specifying the field of the data.frame (generated by .generateDotPlotData
) containing the significance information.
This is to be used for coloring when ColorBy="None"
.
.colorByNoneDotPlotScale(x)
will return a string containing a ggplot2 command to add a default color scale when ColorBy="None"
.
.generateDotPlot(x, labels, envir)
returns a list containing plot
and commands
, using the inital ColumnDataPlot ggplot and adding vertical lines demarcating the log-fold change threshold.
Aaron Lun
RowDataPlot, for the base class.
# Making up some results: se <- SummarizedExperiment(matrix(rnorm(10000), 1000, 10)) rownames(se) <- paste0("GENE_", seq_len(nrow(se))) rowData(se)$PValue <- runif(nrow(se)) rowData(se)$LogFC <- rnorm(nrow(se)) rowData(se)$AveExpr <- rnorm(nrow(se)) if (interactive()) { iSEE(se, initial=list(VolcanoPlot())) }