Learn R Programming

geneSignatureFinder (version 2014.02.17)

classify: Wrapper function to the classification method

Description

This function links the classification method to the procedures to find the seed genes and the signatures. If necessary this function can be rewritten in order to use a different classification method. Actually the classification method linked is the partitioning around medoids (see pam() function for details)

Usage

classify(ddata)

Arguments

ddata
can be either a list of real values (gene expression levels) or a data-matrix where the rows are the samples and the columns are the genes.

Value

  • If ddata is a list of real values (1 gene expression levels) the function calls an unbiased version of pam (see pamUnbiased() function for details). In this case two elements are returned
  • clusterslist of 1-2 indicators of the two clusters.
  • missinglist of T-F logical values where T labels the values set to missing by pamUnbiased().
  • If ddata is a real matrix (more than 1 expression levels) the function calls pam() and returns an object of pam class with an additional slot
  • clusterslist of 1-2 indicators of the two clusters.

Details

The function provides two clusters.

See Also

pam, pam.object.

Examples

Run this code
# univariate classification
data(geNSCLC)
sum(is.na(geNSCLC[, "SELP"]))
ans <- classify(geNSCLC[, "SELP"]) 
table(ans$clusters)
sum(ans$missing)
mean(geNSCLC[which(ans$clusters == 1), "SELP"], na.rm = TRUE)
mean(geNSCLC[which(ans$clusters == 2), "SELP"], na.rm = TRUE)

# multivariate classification
data(geNSCLC)
ddata <- geNSCLC[, c("STX1A", "FADD", "STC1", "RNF5")]
ans <- classify(ddata)$clusters
table(ans)
rbind(apply(ddata[ans == 1, ], 2, mean, na.rm = TRUE),
      apply(ddata[ans == 2, ], 2, mean, na.rm = TRUE))

Run the code above in your browser using DataLab