Learn R Programming

wrGraph (version 1.2.1)

MAplotW: MA-plot (differential intensity versus average intensity)

Description

This type of plot is very common in high-throughput biology, see MA-plot. Basically one would like to compare numerous independent measures (ie gene transcript or protein abundance values) of 2 samples/data-sets, it is usual to compare a change ('Minus'=M) versus absolute mean value ('Average'=A). In high-throughput biology data are typically already transformed to log2 and thus, the 'M'-value represents a relative change. Besides, output from statistical testing by moderTest2grp can be directly read to produce MA plots for diagnostic reasons. Please note, that plotting a very number of points in transparency (eg >10000) may take several seconds.

Usage

MAplotW(
  Mvalue,
  Avalue = NULL,
  filtFin = NULL,
  ProjNa = NULL,
  FCthrs = NULL,
  subTxt = NULL,
  grayIncrem = TRUE,
  compNa = NULL,
  batchFig = FALSE,
  cexMa = 1.8,
  cexLa = 0.7,
  limM = NULL,
  limA = NULL,
  cexPt = NULL,
  cexSub = NULL,
  useMar = c(6.2, 4, 4, 2),
  callFrom = "",
  silent = FALSE,
  debug = FALSE
)

Arguments

Mvalue

(numeric or matrix) data to plot; M-values are typically calculated as difference of log2-abundance values and 'Avalue' the mean of log2-abundance values; M-values and A-values may be given as 2 columsn of a matrix, in this case the argument Avalue should remain NULL

Avalue

(numeric, list or data.frame) if NULL it is assumed that 2nd column of 'Mvalue' contains the A-values to be used

filtFin

(matrix or logical) The data may get filtered before plotting: If FALSE no filtering will get applied; if matrix of TRUE/FALSE it will be used as optional custom filter, otherwise (if Mvalue if an MArrayLM-object eg from limma) a default filtering based on the filtFin element will be applied

ProjNa

(character) custom title

FCthrs

(numeric) Fold-Change threshold (display as line) give as Fold-change and NOT log2(FC)

subTxt

(character) custom sub-title

grayIncrem

(logical) if TRUE, display overlay of points as increased shades of gray

compNa

(character) names of groups compared (as colnames of Mvalue$means)

batchFig

(logical) if TRUE figure title and axes legends will be kept shorter for display on fewer splace

cexMa

(numeric) expansion factor for font-size of title (see also par)

cexLa

(numeric) expansion factor cex for labels (see also par)

limM

(numeric, length=2) range of axis M-values

limA

(numeric, length=2) range of axis A-values

cexPt

(numeric) expansion factor cex for points (see also par)

cexSub

(numeric) expansion factor cex for subtitle (see also par)

useMar

(numeric,length=4) custom margings (see also par)

callFrom

(character) allow easier tracking of message(s) produced

silent

(logical) suppress messages

debug

(logical) additional messages for debugging

Value

MA-plot only

See Also

(for PCA) plotPCAw

Examples

Run this code
# NOT RUN {
library(wrMisc)
set.seed(2005); mat <- matrix(round(runif(600),1),ncol=6)
rownames(mat) <- c(rep(letters[1:25],each=3),letters[2:26])
MAplotW(mat[,2]-mat[,1], rowMeans(mat))
## assume 2 groups with 3 samples each
matMeans <- rowGrpMeans(mat, gr=gl(2,3,labels=LETTERS[3:4]))
MAplotW(matMeans[,2]-matMeans[,1], matMeans) 
## assume 2 groups with 3 samples each and run moderated t-test (from package 'limma')
tRes <- moderTest2grp(mat,gl(2,3))
MAplotW(tRes$Mval, tRes$Amean)                          
MAplotW(M=tRes$Mval, A=tRes$means, FCth=1.3) 
MAplotW(tRes)
MAplotW(tRes, limM=c(-2,2), FCth=1.3) 

# }

Run the code above in your browser using DataLab