Learn R Programming

ClassifyR (version 1.6.2)

plotFeatureClasses: Plot Density and Scatterplot for Genes By Class

Description

Allows the visualisation of genes which were selected by a feature selection method.

Usage

"plotFeatureClasses"(expression, classes, ...) "plotFeatureClasses"(expression, rows, whichPlots = c("both", "density", "stripchart"), xAxisLabel = expression(log[2](expression)), expressionLimits = c(2, 16), yAxisLabels = c("Density", "Classes"), showXtickLabels = TRUE, showYtickLabels = TRUE, xLabelPositions = "auto", yLabelPositions = "auto", fontSizes = c(24, 16, 12, 12, 12), colours = c("blue", "red"), plot = TRUE)

Arguments

expression
Either a matrix or ExpressionSet containing the training data. For a matrix, the rows are features, and the columns are samples.
classes
A vector of class labels.
...
Unused variables from the matrix method passed to the ExpressionSet method.
rows
A vector specifying which rows of the matrix to plot.
whichPlots
Which plots to draw. Can draw either a density plot, stripchart, or both.
xAxisLabel
The axis label for the expression axis.
yAxisLabels
A character vector of length 2. The first value is the y-axis label for the density plot. The second value is the y-axis labels for the stripchart. Provide both labels, even if only plotting one kind of plot.
expressionLimits
The minimum and maximum expression values to plot. Set to NULL to use range of data.
showXtickLabels
Logical. IF FALSE, the x-axis labels are hidden.
showYtickLabels
Logical. IF FALSE, the y-axis labels are hidden.
xLabelPositions
Either "auto" or a vector of values. The positions of labels on the x-axis. If "auto", the placement of labels is automatically calculated.
yLabelPositions
Either "auto" or a vector of values. The positions of labels on the y-axis. If "auto", the placement of labels is automatically calculated.
fontSizes
A vector of length 5. The first number is the size of the title. The second number is the size of the axes titles. The third number is the size of the axes values. The fourth number is the size of the legends' titles. The fifth number is the font size of the legend labels.
colours
The colours to plot data of each class in.
plot
Logical. If TRUE, a plot is produced on the current graphics device.

Value

Plots.

Examples

Run this code
  # First 25 samples are mixtures of two normals. Last 25 samples are one normal.
  genesMatrix <- sapply(1:25, function(geneColumn) c(rnorm(50, 5, 1), rnorm(50, 15, 1)))
  genesMatrix <- cbind(genesMatrix, sapply(1:25, function(geneColumn) rnorm(100, 9, 3)))
  classes <- factor(rep(c("Poor", "Good"), each = 25), levels = c("Good", "Poor"))
  chosen <- 1:5 # First five genes in the data were chosen.
                                     
  plotFeatureClasses(genesMatrix, classes, chosen, expressionLimits = NULL)

Run the code above in your browser using DataLab