addMarkers {pRoloc} | R Documentation |
The function adds a 'markers' feature variable. These markers are
read from a comma separated values (csv) spreadsheet file. This
markers file is expected to have 2 columns (others are ignored)
where the first is the name of the marker features and the second
the group label. Alternatively, a markers named vector as provided
by the pRolocmarkers
function can also be used.
addMarkers(object, markers, mcol = "markers", fcol, verbose = TRUE)
object |
An instance of class |
markers |
A |
mcol |
A |
fcol |
An optional feature variable to be used to match against the markers. If missing, the feature names are used. |
verbose |
A |
It is essential to assure that featureNames(object)
(or
fcol
, see below) and marker names (first column) match,
i.e. the same feature identifiers and case fold are used.
A new instance of class MSnSet
with an additional
markers
feature variable.
Laurent Gatto
See pRolocmarkers
for a list of spatial
markers and markers
for details about markers
encoding.
library("pRolocdata") data(dunkley2006) atha <- pRolocmarkers("atha") try(addMarkers(dunkley2006, atha)) ## markers already exists fData(dunkley2006)$markers.org <- fData(dunkley2006)$markers fData(dunkley2006)$markers <- NULL marked <- addMarkers(dunkley2006, atha) fvarLabels(marked) ## if 'makers' already exists marked <- addMarkers(marked, atha, mcol = "markers2") fvarLabels(marked) stopifnot(all.equal(fData(marked)$markers, fData(marked)$markers2)) plot2D(marked) addLegend(marked, where = "topleft", cex = .7)