NSCselectionInterface: Interface for 'pamr.listgenes' Function from 'pamr' CRAN...

Description Usage Arguments Details Value Author(s) See Also Examples

Description

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

Usage

1
2
3
4
5
6
7
  ## S4 method for signature 'matrix'
NSCselectionInterface(measurements, classes, ...)
  ## S4 method for signature 'DataFrame'
NSCselectionInterface(measurements, classes, datasetName,
                   trained, ..., selectionName = "Shrunken Centroids", verbose = 3)
  ## S4 method for signature 'MultiAssayExperiment'
NSCselectionInterface(measurements, targets = names(measurements), ...)

Arguments

measurements

Either a matrix, DataFrame or MultiAssayExperiment containing the training data. For a matrix, the rows are features, and the columns are samples.

classes

Either a vector of class labels of class factor of the same length as the number of samples in measurements or if the measurements are of class DataFrame a character vector of length 1 containing the column name in measurement is also permitted. Not used if measurements is a MultiAssayExperiment object.

targets

If measurements is a MultiAssayExperiment, the names of the data tables to be used. "clinical" is also a valid value and specifies that numeric variables from the clinical data table will be used.

datasetName

A name for the data set used. Stored in the result.

trained

The output of NSCtrainInterface, which is identical to the output of pamr.listgenes.

...

Variables not used by the matrix nor the MultiAssayExperiment method which are passed into and used by the DataFrame method or extra arguments passed to pamr.listgenes.

selectionName

A name to identify this selection method by. Stored in the result.

verbose

Default: 3. 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.

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 NSCtrainInterface and using the threshold that obtains the lowest cross-validation error rate on the training set.

Value

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

Author(s)

Dario Strbenac

See Also

pamr.listgenes for the function that was interfaced to.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
  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))))
    rownames(genesMatrix) <- paste("Gene", 1:nrow(genesMatrix))                                 
    classes <- factor(rep(c("Poor", "Good"), each = 25))
    
    trained <- NSCtrainInterface(genesMatrix, classes)
    selected <- NSCselectionInterface(genesMatrix, classes, "Example", trained)
                                                          
    selected@chosenFeatures                                                         
  }

ClassifyR documentation built on Nov. 8, 2020, 6:53 p.m.