Scales for y aesthetic mapped to P-values as used in volcano plots with transcriptomics and metabolomics data.
Usage
scale_y_Pvalue(
...,
name = expression(italic(P) - plain(value)),
transform = NULL,
breaks = NULL,
labels = NULL,
limits = c(1, 1e-20),
oob = NULL,
expand = NULL
)
scale_y_FDR(
...,
name = "False discovery rate",
transform = NULL,
breaks = NULL,
labels = NULL,
limits = c(1, 1e-10),
oob = NULL,
expand = NULL
)
scale_x_Pvalue(
...,
name = expression(italic(P) - plain(value)),
transform = NULL,
breaks = NULL,
labels = NULL,
limits = c(1, 1e-20),
oob = NULL,
expand = NULL
)
scale_x_FDR(
...,
name = "False discovery rate",
transform = NULL,
breaks = NULL,
labels = NULL,
limits = c(1, 1e-10),
oob = NULL,
expand = NULL
)
Arguments
- ...
other named arguments passed to
scale_y_continuous
.- name
The name of the scale without units, used for the axis-label.
- transform
Either the name of a transformation object, or the object itself. Use NULL for the default.
- breaks
The positions of ticks or a function to generate them. Default varies depending on argument passed to
log.base.labels
.- labels
The tick labels or a function to generate them from the tick positions. The default is function that uses the arguments passed to
log.base.data
andlog.base.labels
to generate suitable labels.- limits
Use one of:
NULL
to use the default scale range, a numeric vector of length two providing limits of the scale; NA to refer to the existing minimum or maximum; a function that accepts the existing (automatic) limits and returns new limits.- oob
Function that handles limits outside of the scale limits (out of bounds). The default squishes out-of-bounds values to the boundary.
- expand
Vector of range expansion constants used to add some padding around the data, to ensure that they are placed some distance away from the axes. The default is to expand the scale by 15% on each end for log-fold-data, so as to leave space for counts annotations.
Details
These scales only alter default arguments of
scale_x_continuous()
and scale_y_continuous()
. Please, see
documentation for scale_continuous
for details.
See also
Other Functions for quadrant and volcano plots:
FC_format()
,
outcome2factor()
,
scale_colour_outcome()
,
scale_shape_outcome()
,
xy_outcomes2factor()
Examples
set.seed(12346)
my.df <- data.frame(x = rnorm(50, sd = 4),
y = 10^-runif(50, min = 0, max = 20))
ggplot(my.df, aes(x, y)) +
geom_point() +
scale_x_logFC() +
scale_y_Pvalue()
ggplot(my.df, aes(x, y)) +
geom_point() +
scale_x_logFC() +
scale_y_FDR(limits = c(NA, 1e-20))