smoothMAplot: A function to produce MA-plots.

Description Usage Arguments Author(s)

View source: R/src_smoothMAplot.R

Description

The function takes average log2-expression as X.values and logFC as Y.values and then uses smoothScatter() to produce MA-plots. Due to smoothScatter() resulting pdfs are typically small which is the reason we use this function rather than plot() or anything similar. Optionally, if one provides values via P.values, data points whose P.values are below Sig.Thresh will be colored in Sig.Color.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
smoothMAplot(
  X.value,
  Y.value,
  Y.limits = NULL,
  y.quantile.low = 0.001,
  y.quantile.top = 0.999,
  Plot.xlab = "baseMean",
  Plot.ylab = "logFC",
  Plot.title = NULL,
  Plot.title.size = 1,
  Plot.cexlab = 1.5,
  Plot.cexaxis = 1.5,
  Plot.ColorRamp = NULL,
  Points.cex = 0.2,
  use.loessFit = FALSE,
  use.loessFit.Color = "red",
  abline0 = TRUE,
  abline2 = NULL
)

Arguments

X.value

log2 average expression values

Y.value

log2 fold changes

Y.limits

the limits of the y-axis, e.g. like c(-2,2), if NULL then automatically determined based on quantiles to capture most data points while avoiding excessive axis limits due to outliers

Plot.xlab

x-axis label

Plot.ylab

y-axis label

Plot.title

title of the plot,

Plot.title.size

cexsize of title

Plot.cexlab

cex size of the axis labels

Plot.cexaxis

cex size of the axis marks

Plot.ColorRamp

a color ramp for the plot, by default use the standard from smoothScatter() so white to blue

Points.cex

cex size of the data points below the Sig.Thresh

use.loessFit

logical, whether to use loessFit for a fit between Yval and Xval

use.loessFit.Color

color of that abline

abline0

logical, whether to add a y=0 abline

abline2

a numeric value, if set then will plot a horizontal abline at +/- that value

P.values

optional p-values from differential analysis

Sig.Thresh

threshold to select significant data points based on P.values

Sig.Color

color to highlight significant data points, default is firebrick

Add.Legend

logical, whether to add a legend at topright position with a summary of the number of data points above and below Sig.Thresh and the smallest arithmetic (not log2) fold change that was still significant at the given p-value cutoff

Author(s)

Alexander Toenges


ATpoint/diffanalyseR documentation built on Oct. 8, 2021, 10:11 p.m.