MSImageSet
is derived from iSet
through SImageSet
. It extends these classes with information about the processing and analysis, requiring MIAPE-Imaging in its experimentData slot.
## Instance creation
MSImageSet( spectra = Hashmat(nrow=0, ncol=0), mz = seq_len(dim(spectra)[1]), coord = expand.grid( x = seq_len(prod(dim(spectra)[-1])), y = seq_len(ifelse(prod(dim(spectra)[-1]) > 0, 1, 0))), imageData = MSImageData(data=spectra, coord=coord), pixelData = IAnnotatedDataFrame( data=coord, varMetadata=data.frame(labelType=rep("dim", ncol(coord)))), featureData = AnnotatedDataFrame( data=data.frame(mz=mz)), processingData = new("MSImageProcess"), protocolData = AnnotatedDataFrame( data=data.frame(row.names=sampleNames(pixelData))), experimentData = new("MIAPE-Imaging"), ...)
## Additional methods documented below
spectra
matrix. Must be strictly increasing or decreasing.data.frame
with columns representing the spatial dimensions. Each row provides a spatial coordinate for the location of a mass spectrum corresponding to a column in spectra
. This argument is ignored if spectra
is a multidimensional array rather than a matrix.SImageData
that will contain the imaging mass spectra. Usually constructed through the spectra
and coord
arguments.IAnnotatedDataFrame
giving the information about the pixels including coordinates of the data in imageData
.AnnotatedDataFrame
giving information about the data features. Requires a column named "mz".MSImageProcess
giving information about the pre-processing steps applied to the spectra.AnnotatedDataFrame
giving information about the samples. It must have one row for each of the sampleNames
in pixelData
.MIAxE
giving information about the imaging experiment.imageData
:SImageData
, which stores one or more matrices of equal number of dimensions as elements in an 'immutableEnvironment'. This slot preserves copy-on-write behavior when it is modified specifically, but is pass-by-reference otherwise, for memory efficiency.pixelData
:IAnnotatedDataFrame
. This includes both pixel coordinates and phenotypic and sample data. Its rows correspond to the columns in imageData
.featureData
:imageData
in an IAnnotatedDataFrame
.processingData
:MSImageProcess
.experimentData
:MIAPE-Imaging
.protocolData
:pixelData
in an IAnnotatedDataFrame
..__classVersion__
:Versions
object describing the version of the class used to created the instance. Intended for developer use.SImageSet
, directly.
iSet
, by class "SImageSet", distance 1.
VersionedBiobase
, by class "iSet", distance 2.
Versioned
, by class "VersionedBiobase", distance 3.MSImageSet
instances can be created through MSImageSet()
, but are more commonly created through reading of external data files.spectra(object), spectra(object) <- value
:imageData
. This is a matrix-like object with rows corresponding to features and columns corresponding to pixels, so that each column of the returned object is a mass spectrum.peaks(object), peaks(object) <- value
:imageData
if peak picking have been performed. This is a shortcut for peakData(imageData(object))
. These are the unaligned peaks. Aligned peaks (if they exist) are accesed by spectra(object).mz(object), mz(object) <- value
:featureData
.features(object, ..., mz)
:featureData
) corresponding to variables in featureData
. Bisection search is used for fuzzy matching of m/z values.pixels(object, ..., coord)
:pixelData
) corresponding to variables in pixelData
. If specified, coord
should be a data.frame
where each row corresponds to the coordinates of a desired pixel.centroided(object), centroided(object) <- value
:centroided(processingData(object))
. A setter is also provided, and is sometimes necessary for forcing some analysis methods to accept unprocessed spectra. (This is usually a bad idea.)processingData(object), processingData(object) <- value
:processingData
slot.combine(x, y, ...)
:MSImageSet
objects. Unique 'sample's in pixelData
are treated as a dimension.MSImageSet[i, j, ..., drop]
:SImageSet
based on the rows (featureData components) and the columns (pixelData components). The result is a new MSImageSet
.iSet
and SImageSet
for additional methods.iSet
,
SImageSet
## Create an MSImageSet object
spectra <- matrix(1:27, nrow=3)
mz <- 101:103
coord <- expand.grid(x=1:3, y=1:3)
msset <- MSImageSet(spectra=spectra, mz=mz, coord=coord)
## Access a single image corresponding to the first feature
imageData(msset)[1,,]
## Reconstruct the datacube
imageData(msset)[]
## Access the P x N matrix of column-wise mass spectra
spectra(msset)
## Subset the MSImageSet to the first 2 m/z values and first 6 mass spectra
msset2 <- msset[1:2, 1:6]
imageData(msset2)[]
msset2
Run the code above in your browser using DataLab