Object Oriented Microarray Library: Gene-By-Sample

The gbs module provides the definition of the gbs function. See the bottom of the page for an example of how the function can be used.

Plotting Gene Expression By Sample

Functions

gbs(index, data, fac, labels, genes, cex, clip, ...)
This function provides a plot summarizing the expression of genes in a way that allows you to see how they change across sample types. The first argument, index, is an integer index into a data structure. This index ties together the data and genes arguments. The former should be a data frame (or an object with an as.data.frame method) containing numerical values of gene expression; the rows represent genes, and the columns represent samples. The latter is another data frame whose rows describe the genes. This data frame must also be an object of a design class that implements the get.name and get.accession methods. The fac argument is a factor that classifies the samples; when there are only two classes, you may use a logical vector instead of a factor. The optional labels argument gives the names of the sample types. It defaults to the names of the different factor levels, or (in the case of a logical vector) to c('A", 'B'). The optional cex argument is used to set the size of the title; this will be important if you try to plot several of these graphs on the same page. The default value is 1. The optional clip argument specifies in characters the maximum allowable length of the text string describing the gene; the default value is 45 characters.

Description

The gbs function produces plots that group samples by type, plotting the (log) intensity of the expression values or ratios as a function of the individual samples. Vertical bars are added to the plot to separate sample types, and short horizontal bars are added to indicate the median expression level in each sample type.

Example

  gene.info <- cg4.short.gene.list
  n.genes <- dim(gene.info)[1]
  n.samples <- 30

  bogus <- matrix(rnorm(n.samples*n.genes, 0, 3), ncol=n.samples)
  splitter <- rep(F, n.samples)
  splitter[sample(1:n.samples, trunc(n.samples/2))] <- T

  opar <- par(mfrow=c(3,3))
  for (i in sample(1:n.genes, 9)) { 
	gbs(i, bogus, splitter, genes=gene.info, cex=0.4)
  }
  par(opar)