plotAmpliconduo {AmpliconDuo} | R Documentation |
Frequeny-Frequency Plot Focusing On Significant Deviations In Amplicon Occurences
Description
Applied to an ampliconduo data frame, one element of the return value of
the ampliconduo
function. Generates a plot of freqB
over freqA
(the read numbers of the same amplicon in both halves
A and B of a split sample). For amplicons that have significantly
deviating read numbers, i.e. with a p-value or adjusted p-value below a
certain treshold, points are colored differently (default: red).
Usage
plotAmpliconduo(x, color.treshold = 0.05, xlab = "Abundance (PCR A)",
ylab = "Abundance (PCR B)",main = NULL, log = "xy", corrected = TRUE, asp = 1,
legend.position = NULL, save = FALSE, path = NULL, file.name = NULL,
format = "jpeg", h.start = 0, ...)
Arguments
x |
Ampliconduo data frame, an element of the returned list of the |
color.treshold |
Optional. Numeric value specifying at which p-value or adjusted p-value points in the plot are drawn in complementary color. Default value is 0.05. |
xlab |
Optional. Character indicating the x-axis label. Default is “Abundance (PCR A)”. |
ylab |
Optional. Character indicating the y-axis label. Default is “Abundance (PCR B)”. |
main |
Optional. Character specifying the overall title of the plot. If no value is passed, takes the
sample name from the |
log |
Optional. Character specifying the variables to transform to log (“”,“x”, “y”, or “xy”). Default is “xy”. |
corrected |
Optional. Logical to decide whether the p-value ( |
asp |
Optional. Numeric value, the y/x aspect ratio. Default is 1. |
legend.position |
Optional. Numeric vector of length two. Defines the position of the legend. By default tries to find a position that fits best the arrangement of the plots. |
save |
Optional. Logical value indicationg if the plot should be saved to file. Default value is |
path |
Optional. Character, in case the argument |
file.name |
Optional. If argument |
format |
Optional. Character specifying the format of the saved file. One of “eps”, “ps”, “tex”, “pdf”, “jpeg”, “tiff”, “png”, “bmp”, “svg” and “wmf” (windows only). Default format is “jpeg”. |
h.start |
Optional. Numeric value between 0 and 360 defines the color of the plotted points. Default value is 0 (blue-green, red). |
... |
Optional. Allows to pass other aesthetics. |
Author(s)
Anja Lange & Daniel Hoffmann
References
https://ggplot2.tidyverse.org/reference/qplot.html
See Also
ggplot2 package
qplot
internally used to create the plot.
plotAmpliconduo.set
, generates a very similar plot for a list of ampliconduo data frames.
ampliconduo
, generates the input data.
Examples
## load example data
data(amplicons)
## extract the second ampliconduo data frame
ampliconduo2 <- amplicons[[2]]
## plot the amplicon frequencies of the ampliconduo data frame
plotAmpliconduo(ampliconduo2, main = "ampliconduo_2")
plotAmpliconduo(ampliconduo2, main = "ampliconduo_2", h.start = 50, log = "")
plotAmpliconduo(ampliconduo2, h.start = 50, log = "", asp = 2, corrected = FALSE)