Description Usage Arguments Details Value See Also Examples
Predict classes for new samples based on cola classification
1 2 3 4 5 6 7 8 9 10 | ## 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, force = FALSE,
verbose = TRUE, help = TRUE, prefix = "")
|
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 |
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 |
force |
If the value is |
verbose |
Whether to print messages. Send to |
help |
Whether to print help messages. |
prefix |
Used internally. |
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 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.