Learn R Programming

Cardinal (version 1.4.0)

topLabels-methods: Retrieve Top-Ranked Labels from Analysis Results

Description

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.

Usage

"topLabels"(object, n = 6, model = pData(modelData(object)), type = c('+', '-', 'b'), sort.by = fvarLabels(object), filter = list(), ...)
"topLabels"(object, n = 6, sort.by = "loadings", ...)
"topLabels"(object, n = 6, sort.by = c("coefficients", "loadings", "weights"), ...)
"topLabels"(object, n = 6, sort.by = c("coefficients", "loadings", "Oloadings", "weights", "Oweights"), ...)
"topLabels"(object, n = 6, sort.by = c("betweenss", "withinss"), ...)
"topLabels"(object, n = 6, sort.by = c("tstatistics", "p.values"), ...)
"topLabels"(object, ...)

Arguments

object
A ResultSet derived object.
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 ResultSet. This can name the models explicitly or specify a list of parameter values.
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.

Value

A data.frame with the top-ranked labels from the analysis.

See Also

ResultSet, PCA, PLS, OPLS, spatialKMeans, spatialShrunkenCentroids

Examples

Run this code
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))

Run the code above in your browser using DataLab