Learn R Programming

ClassifyR (version 1.6.2)

nearestShrunkenCentroidSelectionInterface: Interface for pamr.listgenes Function from pamr CRAN Package

Description

Restructures variables from ClassifyR framework to be compatible with pamr.listgenes definition.

Usage

"nearestShrunkenCentroidSelectionInterface"(expression, classes, ...) "nearestShrunkenCentroidSelectionInterface"(expression, datasetName, trained, ..., selectionName = "Shrunken Centroids", verbose = 3)

Arguments

expression
Either a matrix or ExpressionSet containing the training data. For a matrix, the rows are features, and the columns are samples.
datasetName
A name for the dataset used. Stored in the result.
classes
A vector of class labels.
trained
The output of nearestShrunkenCentroidTrainInterface, which is identical to the output of pamr.listgenes.
...
Extra arguments passed to pamr.listgenes or parameters not used by the matrix method that are passed to the ExpressionSet method.
selectionName
A name to identify this selection method by. Stored in the result.
verbose
A number between 0 and 3 for the amount of progress messages to give. This function only prints progress messages if the value is 3.

Value

An object of class SelectResult. The rankedFeatures slot will be empty.

Details

This function is an interface between the ClassifyR framework and pamr.listgenes. The set of features chosen is the obtained by considering the range of thresholds provided to nearestShrunkenCentroidTrainInterface and using the threshold that obtains the lowest cross-validation error rate on the training set.

See Also

pamr.listgenes for the function that was interfaced to.

Examples

Run this code
  if(require(pamr))
  {
    # Genes 76 to 100 have differential expression.
    genesMatrix <- sapply(1:25, function(geneColumn) c(rnorm(100, 9, 1)))
    genesMatrix <- cbind(genesMatrix, sapply(1:25, function(geneColumn)
                                 c(rnorm(75, 9, 1), rnorm(25, 14, 1))))
    classes <- factor(rep(c("Poor", "Good"), each = 25))
    
    trained <- nearestShrunkenCentroidTrainInterface(genesMatrix, classes)
    nearestShrunkenCentroidSelectionInterface(genesMatrix, classes, "Example", trained)
  }

Run the code above in your browser using DataLab