predict_classes-ConsensusPartition-method | R Documentation |
Predict classes for new samples based on cola classification
## 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",
method = "centroid",
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)
object |
A |
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 |
silhouette_cutoff |
Send to |
fdr_cutoff |
Send to |
group_diff |
Send to |
scale_rows |
Send to |
diff_method |
Send to |
method |
Method for predicting class labels. Possible values are "centroid", "svm" and "randomForest". |
dist_method |
Distance method. Value should be "euclidean", "correlation" or "cosine". Send to |
nperm |
Number of permutatinos. It is used when |
p_cutoff |
Cutoff for the p-values for determining class assignment. Send to |
plot |
Whether to draw the plot that visualizes the process of prediction. Send to |
col_fun |
A color mapping function generated from |
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 |
verbose |
Whether to print messages. Send to |
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 |
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.
A data frame with two columns: the class labels (in numeric) and the corresponding p-values.
predict_classes,matrix-method
that predicts the classes for new samples.
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"])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.