R: Plots Log-Fold Change versus Log-Concentration (or, M versus...
maPlot
R Documentation
Plots Log-Fold Change versus Log-Concentration (or, M versus A) for Count Data
Description
To represent counts that were low (e.g. zero in 1 library and non-zero in the other) in one of the two conditions, a 'smear' of points at low A value is presented.
vector providing the abundance of each gene on the log2 scale. Purely optional (default is NULL), but in combination with logFC provides a more direct way to create an MA-plot if the log-abundance and log-fold change are available.
logFC
vector providing the log-fold change for each gene for a given experimental contrast. Default is NULL, only to be used together with logAbundance as both need to be non-null for their values to be used.
normalize
logical, whether to divide x and y vectors by their sum
plot.it
logical, whether to produce a plot
smearWidth
scalar, width of the smear
col
vector of colours for the points (if NULL, uses allCol and lowCol)
allCol
colour of the non-smeared points
lowCol
colour of the smeared points
deCol
colour of the DE (differentially expressed) points
de.tags
indices for genes identified as being differentially expressed; use exactTest or glmLRT to identify DE genes. Note that ‘tag’ and ‘gene’ are synonymous here.
smooth.scatter
logical, whether to produce a 'smooth scatter' plot using the KernSmooth::smoothScatter function or just a regular scatter plot; default is FALSE, i.e. produce a regular scatter plot
lowess
logical, indicating whether or not to add a lowess curve to the MA-plot to give an indication of any trend in the log-fold change with log-concentration
...
further arguments passed on to plot
Details
The points to be smeared are identified as being equal to the minimum in one of the two groups. The smear is created by using random uniform numbers of width smearWidth to the left of the minimum A value.
Value
a plot to the current device (if plot.it=TRUE), and invisibly returns the M (logFC) and A (logConc) values used for the plot, plus identifiers w and v of genes for which M and A values, or just M values, respectively, were adjusted to make a nicer looking plot.
Author(s)
Mark Robinson, Davis McCarthy
See Also
plotSmear
Examples
y <- matrix(rnbinom(10000,mu=5,size=2),ncol=4)
maPlot(y[,1], y[,2])
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(edgeR)
Loading required package: limma
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/edgeR/maPlot.Rd_%03d_medium.png", width=480, height=480)
> ### Name: maPlot
> ### Title: Plots Log-Fold Change versus Log-Concentration (or, M versus A)
> ### for Count Data
> ### Aliases: maPlot
>
> ### ** Examples
>
> y <- matrix(rnbinom(10000,mu=5,size=2),ncol=4)
> maPlot(y[,1], y[,2])
>
>
>
>
>
> dev.off()
null device
1
>