plotAmpliconduo {AmpliconDuo}R Documentation

Frequeny-Frequency Plot Focusing On Significant Deviations In Amplicon Occurences


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


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, = NULL,
format = "jpeg", h.start = 0, ...)



Ampliconduo data frame, an element of the returned list of the ampliconduo function.


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.


Optional. Character indicating the x-axis label. Default is “Abundance (PCR A)”.


Optional. Character indicating the y-axis label. Default is “Abundance (PCR B)”.


Optional. Character specifying the overall title of the plot. If no value is passed, takes the sample name from the x$sample column.


Optional. Character specifying the variables to transform to log (“”,“x”, “y”, or “xy”). Default is “xy”.


Optional. Logical to decide whether the p-value (FALSE), or corrected p-value (TRUE) is used for coloring. Default value is TRUE.


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


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.


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


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.

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


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


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.


Anja Lange & Daniel Hoffmann


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.


## load example data

## 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)

[Package AmpliconDuo version 1.1.1 Index]