Plots for an ampliconduo data frame probability densities of the odds ratios of amplicon occurences in the two amplicon data sets.
The function allows to shift the two extrema (odds ratios OR = 0 and OR
= infinity) to the edges of the plot.
Plots of multipe ampliconduo data frames are arranged in a 2-dimensional array with shared scales.
List or a single ampliconduo data frame, return value of the ampliconduo function.
log
Optional. Character specifying the variables to transform to log (“”,“x”, “y”, or “xy”).
Default is “x”.
ncol
Optional. Integer value specifying the numer of columns used to arrange the plots. Default is 2.
adjust.zeroinf
Optional. Logical, specifies whether the density bar for 0 and inf should be shifted. Default value is TRUE.
zero.pos
Optional. Numeric, in case adjust.zeroinf is set to TRUE, determines the position for the odds ratio = 0 bar.
Default value is 0.05.
inf.pos
Optional. Numeric, in case adjust.zeroinf is set to TRUE, gives the position for the odds ratio = inf bar.
Default value is 200.
binwidth
Optional. Numeric, bin width to use, default is 0.15.
color
Optional. Character, name of the color used to draw the density bars. Default is “black”.
xlab
Optional. Character, label for the x-axis. Default is “odds ratio”.
save
Optional. Logical, TRUE to save the plot, else FALSE. Default 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”.
...
Optional. Allows to pass other aesthetics.
Author(s)
Anja Lange
&
Daniel Hoffmann
See Also
qplot, used by plotAmpliconduo.set to create the plots.
facet_wrap, called for 2-dimensional arrangement of the plots.
ampliconduo, generates the input data.
Examples
## loads example data of ampliconduo data frames
data(amplicons)
## plot odds ratio density for amplicon frequencies in ampliconduo data frames
plotORdensity(amplicons)
plotORdensity(amplicons[1:4], binwidth = 0.1, color = "magenta")
plotORdensity(amplicons[[1]], binwidth = 0.1, color = "orange", main = "Sample FU25")
plotORdensity(amplicons[1:4], color = "darkblue", ncol = 2, save = TRUE)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(AmpliconDuo)
Loading required package: ggplot2
Loading required package: xtable
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/AmpliconDuo/plotORdensity.Rd_%03d_medium.png", width=480, height=480)
> ### Name: plotORdensity
> ### Title: Probability Density Plot Of Odds Ratios
> ### Aliases: plotORdensity
> ### Keywords: hplot
>
> ### ** Examples
>
> ## loads example data of ampliconduo data frames
> data(amplicons)
>
> ## plot odds ratio density for amplicon frequencies in ampliconduo data frames
> plotORdensity(amplicons)
> plotORdensity(amplicons[1:4], binwidth = 0.1, color = "magenta")
> plotORdensity(amplicons[[1]], binwidth = 0.1, color = "orange", main = "Sample FU25")
> plotORdensity(amplicons[1:4], color = "darkblue", ncol = 2, save = TRUE)
Saving 6.67 x 6.67 in image
>
>
>
>
>
>
> dev.off()
null device
1
>