plotLogRatio: Plot a summary gene expression graph

Description Usage Arguments Value Ordering Colors Author(s) See Also Examples

View source: R/plotLogRatio.R

Description

Plot ratios of expression values observed in a treatment versus those of a reference. First the ratios and variances are computated on the gene expression data.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
plotLogRatio(
  e,
  reference,
  within = NULL,
  across = NULL,
  nReplicatesVar = 3,
  filename = "Rplots",
  device = "svg",
  orderBy = list(rows = "hclust", cols = NULL),
  colorsColumns = NULL,
  colorsColumnsBy = NULL,
  colorsColumnsByPalette = c("#1B9E77", "#D95F02", "#7570B3", "#E7298A", "#66A61E",
    "#E6AB02", "#A6761D", "#666666"),
  colorsUseMeanQuantiles = FALSE,
  colorsMeanQuantilesPalette = c("orange", "red", "darkred"),
  colorsBarsMatrix = NULL,
  colorsGenesNames = c("black"),
  main = paste("log2 ratio's"),
  shortvarnames = NULL,
  longvarnames = NULL,
  gene.length = 50,
  gene.fontsize = 6,
  main.fontsize = 9,
  columnhead.fontsize = 8,
  mx = 1.5,
  exp.width = 1.8,
  exp.height = 0.2,
  log2l.show = TRUE,
  log4l.show = FALSE,
  quantiles.show = FALSE,
  quantiles.compute = c(0.9),
  error.show = TRUE,
  view.psid = FALSE,
  errorLabel = "Error bars show the pooled standard deviation",
  closeX11 = FALSE,
  openFile = FALSE,
  tooltipvalues = FALSE,
  probe2gene = TRUE,
  ...
)

Arguments

e

ExpressionSet object to use

reference

A list with two items: var and level - See details

within

Character vector - names of pData columns - See details

across

Character vector - names of pData columns - See details

nReplicatesVar

Integer - Minimum number of replicates to compute variance

filename

Name of the filename to use. No need to specify extension which will be added according to device.

device

One of 'pdf', 'X11', 'png', 'svg'. For svg device, one X11 device is also opened.

orderBy

See details

colorsColumns

A vector of colors to be used for plotting columns; default value is NULL which ends up with red – see Colors section

colorsColumnsBy

A vector of pData columns which combinations specify different colors to be used – see Colors section

colorsColumnsByPalette

If colorsColumns is NULL, vector of colors to be used for coloring columns potentially splitted by colorsColumnsBy

colorsUseMeanQuantiles

Boolean to indicate if the quantile groups computed on averages over all treatments should be used for coloring – see Colors section

colorsMeanQuantilesPalette

if colorsUseMeanQuantiles is TRUE, these colors will be used for the different groups – see Colors section

colorsBarsMatrix

Matrix of colors to be used for each individual bar; colors are provided for genes in data order and thus are possibly reordered according to orderBy – see Colors sectio

colorsGenesNames

Vector of colors to be used for gene names; will be recycled if necessary; colors are provided for genes in data order and thus are possibly reordered according to orderBy

main

Main title

shortvarnames

ector or pData column to be used to display in graph columns. If NULL, those names will be used from the coded names added to pData during computations (list of columns values pasted with a dot). Warning: shortvarnames must be defined in the order columns are present in the ExpressionSet object so that they will be reordered if one asks to order columns.

longvarnames

pData column to be used in SVG tooltip title. If NULL, shortvarnames will be used. Same warning than shortvarnames about ordering

gene.length

Maximum number of characters that will be printed of the gene names

gene.fontsize

Font size for the gene names , default =

main.fontsize

Font size for the main, default = 9

columnhead.fontsize

Font size for the column headers, default = 8

mx

Expansion factor for the width of the bars that represent the expression ratios

exp.width

Expansion factor for global graph width, and the space between the plotted colum

exp.height

Expansion factor for global graph height, and the space between the plotted row

log2l.show

A logical value. If 'TRUE', the line for log2 values on each column (when max(data) > 2) is draw

log4l.show

A logical value. If 'TRUE', the line for log4 values on each column (when max(data) > 4) is drawn

quantiles.show

A logical value. If 'TRUE', a line is drawn for quantiles computed separately on each column

quantiles.compute

A logical value. If 'TRUE', the vector quantiles will be computed and displayed provided that quantile.show is TRUE

error.show

A logical value. If 'TRUE', errors bars are displayed on the graph (only for those columns for which they are available

view.psid

A logical value. If 'TRUE', the genes psid is displayed on the gene name

errorLabel

A character vector describing the error bars, printed at the bottom of the figu

closeX11

If device is SVG, do we close the required X11 device at the end?

openFile

A logical value. If 'TRUE', the produced output file is opened

tooltipvalues

If device is SVG, one can choose to display each bar separately, with data values as tooltips. Note however that each bar will be considered as a distinct object instead of a column, which will takes much more time to create the graph and produces a much bigger SVG file

probe2gene

Boolean indicating whether the probeset should be translated to a gene symbol (used for the default title of the plot

...

...

Value

The ExpressionSet object with the computated variables is returned.

Ordering

orderBy: A list with two components, rows and cols, each one possibly being NULL (no ordering on the specific dimension). Ordering on cols can be done according to (a) pData column(s) (for example: c('cellline','compound','dose'. Ordering on rows can be done using of the following values:

Colors

The management of colors is very flexible but is a little bit tricky, as a variety of parameters are available to the user. Basically, combinations of arguments allow to set colors for columns headers (text), columns as a whole (different colors for the different columns) or for each of the inividual horizontal bars. By default, everything is red. There are four main different arguments that can be used and that are applied in a consecutive order. Each one may override a previous argument value. Below is a list of arguments and their consecutive actions:

Author(s)

Hinrich Goehlmann and Eric Lecoutre

See Also

computeLogRatio,addQuantilesColors

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
if (require(ALL)){
	data(ALL, package = "ALL")
	ALL <- addGeneInfo(ALL)
	ALL$BTtype <- as.factor(substr(ALL$BT,0,1))
	ALL2 <- ALL[,ALL$BT != 'T1']  # omit subtype T1 as it only contains one sample
	ALL2$BTtype <- as.factor(substr(ALL2$BT,0,1)) # create a vector with only T and B
	
	# Test for differential expression between B and T cells
	tTestResult <- tTest(ALL, "BTtype", probe2gene = FALSE)
	topGenes <- rownames(tTestResult)[1:20]
	
	# plot the log ratios versus subtype B of the top genes 
	LogRatioALL <- computeLogRatio(ALL2, reference=list(var='BT',level='B'))
	a <- plotLogRatio(e=LogRatioALL[topGenes,],openFile=FALSE, tooltipvalues=FALSE, device='pdf',
			colorsColumnsBy=c('BTtype'), main = 'Top 20 genes most differentially between T- and B-cells',
			orderBy = list(rows = "hclust"), probe2gene = TRUE)
## Not run: 		
	a <- plotLogRatio(e=LogRatioALL[topGenes,],openFile=TRUE, tooltipvalues=FALSE, device='pdf',
			colorsColumnsBy=c('BTtype'), main = 'Top 20 genes most differentially between T- and B-cells',
			orderBy = list(rows = "hclust", cols = "sex"), probe2gene = TRUE)

## End(Not run)
}

a4Base documentation built on Nov. 8, 2020, 5:41 p.m.

Related to plotLogRatio in a4Base...