predict_classes-ConsensusPartition-method {cola} | R Documentation

## Predict classes for new samples based on cola classification

### Description

Predict classes for new samples based on cola classification

### Usage

    ## S4 method for signature 'ConsensusPartition'
    predict_classes(object, k, mat,
        silhouette_cutoff = 0.5,
        fdr_cutoff = cola_opt$fdr_cutoff,
        group_diff = cola_opt$group_diff,
        scale_rows = object@scale_rows,
        diff_method = "Ftest",
        dist_method = c("euclidean", "correlation", "cosine"), nperm = 1000,
        p_cutoff = 0.05, plot = TRUE, col_fun = NULL,
        split_by_sigatures = FALSE, force = FALSE,
        verbose = TRUE, help = TRUE, prefix = "",
        mc.cores = 1, cores = mc.cores)

### Arguments

`object` | A `ConsensusPartition-class` object.
`k` | Number of subgroups to get the classifications.
`mat` | The new matrix where the sample classes are going to be predicted. The number of rows should be the same as the original matrix for cola analysis (also make sure the row orders are the same). Be careful that the scaling of `mat` should be the same as that applied in cola analysis.
`silhouette_cutoff` | Send to `get_signatures,ConsensusPartition-method` for determining signatures.
`fdr_cutoff` | Send to `get_signatures,ConsensusPartition-method` for determining signatures.
`group_diff` | Send to `get_signatures,ConsensusPartition-method` for determining signatures.
`scale_rows` | Send to `get_signatures,ConsensusPartition-method` for determining signatures.
`diff_method` | Send to `get_signatures,ConsensusPartition-method` for determining signatures.
`dist_method` | Distance method. Value should be "euclidean", "correlation" or "cosine". Send to `predict_classes,matrix-method`.
`nperm` | Number of permutatinos. It is used when `dist_method` is set to "euclidean" or "cosine". Send to `predict_classes,matrix-method`.
`p_cutoff` | Cutoff for the p-values for determining class assignment. Send to `predict_classes,matrix-method`.
`plot` | Whether to draw the plot that visualizes the process of prediction. Send to `predict_classes,matrix-method`.
`col_fun` | A color mapping function generated from `colorRamp2`. It is set to both heatmaps.
`split_by_sigatures` | Should the heatmaps be split based on k-means on the main heatmap, or on the patterns of the signature heatmap.
`force` | If the value is `TRUE` and when `get_signatures,ConsensusPartition-method` internally failed, top 1000 rows with the highest between-group mean difference are used for constructing the signature centroid matrix. It is basically used internally.
`verbose` | Whether to print messages. Send to `predict_classes,matrix-method`.
`help` | Whether to print help messages.
`prefix` | Used internally.
`mc.cores` | Number of cores. This argument will be removed in future versions.
`cores` | Number of cores, or a `cluster` object returned by `makeCluster`.

### Details

The prediction is based on the signature centroid matrix from cola classification. The processes are as follows:

1. For the provided `ConsensusPartition-class` object and a selected k, the signatures that discriminate classes are extracted by `get_signatures,ConsensusPartition-method`. If number of signatures is more than 2000, only 2000 signatures are randomly sampled. 2. The signature centroid matrix is a k-column matrix where each column is the centroid of samples in the corresponding class, i.e. the mean across samples. If rows were scaled in cola analysis, the signature centroid matrix is the mean of scaled values and vise versa. Please note the samples with silhouette score less than `silhouette_cutoff` are removed for calculating the centroids. 3. With the signature centroid matrix and the new matrix, it calls `predict_classes,matrix-method` to perform the prediction. Please see more details of the prediction on that help page. Please note, the scales of the new matrix should be the same as the matrix used for cola analysis.

### Value

A data frame with two columns: the class labels (in numeric) and the corresponding p-values.

### See Also

`predict_classes,matrix-method` that predicts the classes for new samples.

### Examples

    data(golub_cola)
    res = golub_cola["ATC:skmeans"]
    mat = get_matrix(res)
    # note scaling should be applied here because the matrix was scaled in the cola analysis
    mat2 = t(scale(t(mat)))
    cl = predict_classes(res, k = 3, mat2)
    # compare the real classification and the predicted classification
    data.frame(cola_class = get_classes(res, k = 3)[, "class"],
               predicted = cl[, "class"])
    # change to correlation method
    cl = predict_classes(res, k = 3, mat2, dist_method = "correlation")
    # compare the real classification and the predicted classification
    data.frame(cola_class = get_classes(res, k = 3)[, "class"],
               predicted = cl[, "class"])

[Package cola version 1.8.1 Index]