Plotting function for objects of the outlier_map
class. Produces a
heatmap-style image using ggplot2 syntax, for objects
produced by calcOutlierMap()
.
# S3 method for Map
plot(
x,
color.scheme = NULL,
legend.ticks = 7,
gridlines = NULL,
gridlinecol = "red",
gridlinelwd = 0.5,
gridlinelty = 2,
main = NULL,
y.lab = NULL,
x.lab = NULL,
flags = NULL,
legend.width = 1,
legend.height = 2,
filename = NULL,
plot.width = 14,
plot.height = 8,
plot.scale = 1,
...
)
Plot an image of the passed matrix.
An object of class: outlier_map
Which color scheme to use. Typical choices include:
gplots::redgreen()
gplots::bluered()
How many ticks to place on the color legend.
Numeric vector or logical. Indicates where to draw the horizontal
grid lines that can be used to separate samples (rows). This
should be a vector of the cumulative sum of the horizontal lines to be
drawn, typically something like cumsum(table(data$Sex))
.
Alternatively, TRUE
can be passed whereby the lines are determined by
the "class.tab" element of x$class.tab
(if possible).
Color of the gridlines.
Width of the gridlines.
Line type of the gridlines.
Character. Main title for the plot.
See ggplot2::ggtitle()
for ggplot2
style graphics.
Character. Optional string for the y-axis. Otherwise one is automatically generated (default).
Character. Optional string for the x-axis. Otherwise one is automatically generated (default).
Numeric in [0, 1]
.
For an "outlier_map"
, the proportion of the analytes (columns)
for a given sample that must be outliers for a flag to be placed at the right-axis,
right-axis, thus flagging that sample.
If NULL
(default), 0.05
(5%) is selected.
Width for the color legend.
Height for the color legend.
Optional. If provided, the plot will be written to a file.
The file name must also include the desired file type extension;
this will be used to determine the file type,
e.g. a file named foo.png
will be saved as a PNG
.
See ggplot2::ggsave()
for a full list of file type (device) options.
If "filename != NULL"
, the width of the plot image file.
If "filename != NULL"
, the height of the plot image file.
If "filename != NULL"
, the scale of the plot image file.
Arguments required by the plot()
generic. Currently unused.
Stu Field, Amanda Hiser
ggplot2::ggplot()
, ggplot2::geom_raster()
Other Calc Map:
calcOutlierMap()
,
getOutlierIds()
example_data |>
dplyr::filter(SampleType == "Sample") |>
head(10) |>
calcOutlierMap() |>
plot(flags = 0.05)
Run the code above in your browser using DataLab