plotAmpliconduo.set {AmpliconDuo}R Documentation

Frequeny-Frequency Plot Arrangement Focusing On Significant Deviations In Amplicon Occurences

Description

Called on the return value of the ampliconduo function, a list of ampliconduo data frames. Generates for each ampliconduo data frame a plot with freqB over freqA and arranges them in a 2-dimensional array, whereas plots in the same row and column share the same scale. Points with a p-value or adjusted p-value below a certain treshold are colored differently (default: red) indicating significant deviations of amplicon occurences between the two samples in an ampliconduo data frame.

Usage

plotAmpliconduo.set(x, color.treshold = 0.05, xlab = "Abundance (PCR A)", 
ylab = "Abundance (PCR B)",log = "xy", corrected = TRUE, asp = 1, nrow = 1,
legend.position = NULL, save = FALSE, path = NULL, file.name = NULL,
format = "jpeg", h.start = 0, ...)

Arguments

x

List of ampliconduo data frames, return value of the ampliconduo function.

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)”.

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 (FALSE), or corrected p-value (TRUE) is used for coloring. Default value is TRUE.

asp

Optional. Numeric value, the y/x aspect ratio. Default is 1.

nrow

Optional. Integer value specifying the numer of rows used to arrange the plots. 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 the arrangement of the plots best.

save

Optional. Logical value indicationg if the plot should be saved to file. Default value is FALSE.

path

Optional. Character, in case the argument save was set to TRUE, specifies the directory (no backslash or slash at the end) for saving. By default (parameter save is set to TRUE) the plot is saved in the working directory.

file.name

Optional. If argument save was set to TRUE specifies the file name for the plot. The default name is “ampliconduo_<date>.<file extension>”

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.

Details

Generates an arrangement of plots from the return value of the ampliconduo function, that nicely visualizes those amplicons with a significant deviations in read numbers between the two amplicon data sets. The data in x are transformed and passed to the qplot function. The 2-dimensional arrangement of the different plots is achieved using facet_wrap. Important aestetic parameters like color, aspect ratio, legend position ... are easily customized. Optionally, the plot can be saved in a variety of formats.

Author(s)

Anja Lange & Daniel Hoffmann

References

https://ggplot2.tidyverse.org/reference/qplot.html

See Also

ggplot2 package

qplot, used by plotAmpliconduo.set to create the plots.

facet_wrap, called for 2-dimensional arrangement of the plots.

plotAmpliconduo, generates a very similar plot for a single ampliconduo data frame.

ampliconduo, generates the input data, an ampliconduo data frame.

Examples

## loads example data of ampliconduo data frames
data(amplicons)

## plot amplicon frequencies of multiple ampliconduo data frames
plotAmpliconduo.set(amplicons[1:4], nrow = 3, h.start = 100)

plotAmpliconduo.set(amplicons[1:4], nrow = 1, corrected = FALSE, color.treshold = 0.1)

[Package AmpliconDuo version 1.1.1 Index]