Learn R Programming

MAnorm2 (version 1.2.2)

MAplot.bioCond: Create an MA Plot on Two bioCond Objects

Description

Given two bioCond objects, the function draws an MA plot, which is a scatter plot with signal intensity differences between the two conditions against the average signal intensities across conditions.

Usage

# S3 method for bioCond
MAplot(
  x,
  y,
  col = NULL,
  pch = NULL,
  ylim = c(-6, 6),
  xlab = "A value",
  ylab = "M value",
  plot.legend = TRUE,
  ...
)

Value

The function returns NULL.

Arguments

x, y

Two bioCond objects.

col, pch

Optional length-4 vectors specifying the colors and point characters of 4 types of genomic intervals: common peak regions, peak regions specific to the 2nd condition, peak regions specific to the 1st condition, and the others. Elements are recycled if necessary.

ylim

A length-two vector specifying the plotting range of Y-axis (i.e., the M value). Each M value falling outside the range will be shrunk to the corresponding limit. Setting the option to NULL to suppress this behavior.

xlab, ylab

Labels for the X and Y axes.

plot.legend

A logical value indicating whether to add a legend.

...

Further arguments to be passed to plot.

Details

Genomic intervals are classified based on the occupancy field in each of the two bioCond objects. See bioCond for a full description of the structure of a bioCond object.

See Also

bioCond for creating a bioCond object; MAplot.default for producing an MA plot on normalized signal intensities of two ChIP-seq samples; normalize for performing an MA normalization on ChIP-seq samples; normBioCond for normalizing a set of bioCond objects.

Examples

Run this code
data(H3K27Ac, package = "MAnorm2")
attr(H3K27Ac, "metaInfo")

## Create MA scatter plots for the comparisons between individuals.
# \donttest{
# Perform the MA normalization and construct bioConds to represent
# individuals.
norm <- normalize(H3K27Ac, 4, 9)
norm <- normalize(norm, 5:6, 10:11)
norm <- normalize(norm, 7:8, 12:13)
conds <- list(GM12890 = bioCond(norm[4], norm[9], name = "GM12890"),
              GM12891 = bioCond(norm[5:6], norm[10:11], name = "GM12891"),
              GM12892 = bioCond(norm[7:8], norm[12:13], name = "GM12892"))
autosome <- !(H3K27Ac$chrom %in% c("chrX", "chrY"))
conds <- normBioCond(conds, common.peak.regions = autosome)

# MA plots on pairs of individuals.
MAplot(conds[[1]], conds[[2]], main = "GM12890 vs. GM12891")
abline(h = 0, lwd = 2, lty = 5)
MAplot(conds[[1]], conds[[3]], main = "GM12890 vs. GM12892")
abline(h = 0, lwd = 2, lty = 5)
MAplot(conds[[2]], conds[[3]], main = "GM12891 vs. GM12892")
abline(h = 0, lwd = 2, lty = 5)
# }

Run the code above in your browser using DataLab