Object Oriented Microarray Library: Utility Functions

The utility module provides the definition of a number of general purpose utility functions. See the bottom of the page for an example of how they can be used.

Functions

flipud(x)
The argument is a matrix; the return value is a matrix of the same size that has been flipped vertically.
fliplr(x)
The argument is a matrix; the return value is a matrix of the same size that has been flipped horizontally.
ellipse(a, b, ...)
Adds an ellipse to an existing plot, centered at the origin, with semimajor and semiminor axes of length a and b, oriented along the coordinate axes.
f.above.thresh(a, t)
The first argument is a vector; the second argument is a scalar (which defaults to 1). The return value is a fraction describing how many elements in a are larger than t.
f.cord(x, y)
The inputs are vectors of the same length; the return value is the concordance coefficient.
f.qq(x, main, cut, ...)
Produces a normal probability plot (by combining qqnorm and qqline) and adds horizontal lines as indicated by the integer argument cut.
f.qt(x, df, main, cut, ...)
Produces a probability plot (by combining qqplot and the equivalent of qqline) comparing the observed data to a standard t-distribution with df degrees of freedom. Optionally adds horizontal lines as indicated by the integer argument cut.
stdize(x)
Returns the standardized values of the input vector x (by subtracting the mean and dividing by the standard deviation).

Example

  mat <- matrix(1:6, 2, 3)
  mat
  flipud(mat)
  fliplr(mat)

  x <- rnorm(1000, 1, 2)
  y <- rnorm(1000, 1, 2)
  f.above.thresh(x, 0)
  f.above.thresh(y, 0)
  f.cord(x, y)

  plot(x,y)
  ellipse(1, 1, col=6, type='l', lwd=2)
  ellipse(3, 2, col=6, type='l', lwd=2)