classifyInterface: An Interface for PoiClaClu Package's Classify Function

Description Usage Arguments Details Value Author(s) Examples

Description

More details of Poisson LDA are available in the documentation of Classify.

Usage

1
2
3
4
5
6
  ## S4 method for signature 'matrix'
classifyInterface(measurements, classes, test, ...)
  ## S4 method for signature 'DataFrame'
classifyInterface(measurements, classes, test, ..., verbose = 3)
  ## S4 method for signature 'MultiAssayExperiment'
classifyInterface(measurements, test, 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. If of type DataFrame, the data set is subset to only those features of type integer.

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.

test

An object of the same class as measurements with no samples in common with measurements and the same number of features as it.

targets

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

...

Variables not used by the matrix nor the MultiAssayExperiment method which are passed into and used by the DataFrame method or parameters that Classify can accept.

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

Data tables which consist entirely of non-integer data cannot be analysed. If measurements is an object of class MultiAssayExperiment, the factor of sample classes must be stored in the DataFrame accessible by the colData function with column name "class".

Value

A result list, the same as is returned by Classify.

Author(s)

Dario Strbenac

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
  if(require(PoiClaClu))
  {
    readCounts <- CountDataSet(n = 100, p = 1000, 2, 5, 0.1)
    # Rows are for features, columns are for samples.
    trainData <- t(readCounts[['x']])
    classes <- readCounts[['y']]
    testData <- t(readCounts[['xte']])
    storage.mode(trainData) <- storage.mode(testData) <- "integer"
    classified <- classifyInterface(trainData, classes, testData)
    
    setNames(table(readCounts[["yte"]] == classified[["ytehat"]]),
             c("Incorrect", "Correct"))
  }

ClassifyR documentation built on June 20, 2018, 2 a.m.