Learn R Programming

ClassifyR (version 1.2.4)

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, trained, ..., 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.
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
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

A list of length 2. The first element is empty. The second element has the features that were chosen after applying the threshold.

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))
  {
    # Samples in one class with differential expression to other class.
    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, trained)[[2]]
  }

Run the code above in your browser using DataLab