topLabels-methods {Cardinal} | R Documentation |
The generic function is a convenience method for retrieving top-ranked labels from the results of imaging experiment analyses. For mass spectrometry-based imaging experiments, this can be used for identifying important masses from an analysis.
## S4 method for signature 'ResultSet' topLabels(object, n = 6, model = pData(modelData(object)), type = c('+', '-', 'b'), sort.by = fvarLabels(object), filter = list(), ...) ## S4 method for signature 'PCA' topLabels(object, n = 6, sort.by = "loadings", ...) ## S4 method for signature 'PLS' topLabels(object, n = 6, sort.by = c("coefficients", "loadings", "weights"), ...) ## S4 method for signature 'OPLS' topLabels(object, n = 6, sort.by = c("coefficients", "loadings", "Oloadings", "weights", "Oweights"), ...) ## S4 method for signature 'SpatialKMeans' topLabels(object, n = 6, sort.by = c("betweenss", "withinss"), ...) ## S4 method for signature 'SpatialShrunkenCentroids' topLabels(object, n = 6, sort.by = c("tstatistics", "p.values"), ...) ## S4 method for signature 'CrossValidated' topLabels(object, ...)
object |
A |
n |
The number of top-ranked records to return. |
model |
If more than one model was fitted, results from which should be shown? Defaults to all models in the |
type |
How should the records be ranked? '+' shows greatest values first (decreasing order), '-' shows least values first (increasing order), and 'b' uses decreasing order based on absolute values. |
sort.by |
What variable should be used for sorting? |
filter |
A list of named variables with values to use to filter the results. For example, for testing or classification, this can be used to only show rankings for a particular condition. |
... |
Passed to the 'head' function when sorting the final list of results. |
A data.frame
with the top-ranked labels from the analysis.
Kylie A. Bemis
ResultSet
,
PCA
,
PLS
,
OPLS
,
spatialKMeans
,
spatialShrunkenCentroids
set.seed(1) data <- matrix(c(NA, NA, 1, 1, NA, NA, NA, NA, NA, NA, 1, 1, NA, NA, NA, NA, NA, NA, NA, 0, 1, 1, NA, NA, NA, NA, NA, 1, 0, 0, 1, 1, NA, NA, NA, NA, NA, 0, 1, 1, 1, 1, NA, NA, NA, NA, 0, 1, 1, 1, 1, 1, NA, NA, NA, NA, 1, 1, 1, 1, 1, 1, 1, NA, NA, NA, 1, 1, NA, NA, NA, NA, NA, NA, 1, 1, NA, NA, NA, NA, NA), nrow=9, ncol=9) msset <- generateImage(data, range=c(200, 300), step=1, as="MSImageSet") clust1 <- spatialShrunkenCentroids(msset, r=c(1,2), k=c(2,3), s=c(0,1), method="gaussian") topLabels(clust1) topLabels(clust1, filter=list(classes=1)) topLabels(clust1, filter=list(r=1, k=2, s=1))