MSImagingExperiment-class: MSImagingExperiment: Mass spectrometry imaging experiments

Description Usage Arguments Details Slots Methods Author(s) See Also Examples

Description

The MSImagingExperiment class is designed for mass spectrometry imaging experimental data and metadata. It is designed to contain full MSI experiments, including multiple runs and replicates, potentially across multiple files. Both 2D and 3D imaging experiments are supported, as well as any type of experimental metadata such as diagnosis, subject, time point, etc.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Instance creation
MSImagingExperiment(
    imageData = matrix(nrow=0, ncol=0),
    featureData = MassDataFrame(),
    pixelData = PositionDataFrame(),
    metadata = list(),
    processing = SimpleList(),
    centroided = FALSE)

## Additional methods documented below

Arguments

imageData

Either a matrix-like object with number of rows equal to the number of features and number of columns equal to the number of pixels, or an ImageArrayList.

featureData

A MassDataFrame with feature metadata, with a row for each m/z value.

pixelData

A PositionDataFrame with pixel metadata, with a row for each pixel.

metadata

A list with experimental-level metadata.

processing

A SimpleList with processing steps. This should typically be empty for new objects.

centroided

FALSE if the object contains profile spectra and TRUE if the spectra have been peak-picked and centroided.

Details

The MSImagingExperiment class is designed as a replacement for the MSImageSet class, using a simplified, robust implementation that should be more future-proof and enable better support for large, high-resolution experiments, multimodal experiments, and experiments with specialized needs such as non-gridded pixel coordinates.

Subclasses MSContinuousImagingExperiment and MSProcessedImagingExperiment exist to allow downstream methods to make assumptions about the underlying data storage (dense matrices for 'continous' format and sparse matrices for 'processed' format), which can sometimes allow more efficient computations.

Slots

imageData:

An object inheriting from ImageArrayList, storing one or more array-like data elements with conformable dimensions.

featureData:

Contains feature information in a MassDataFrame. Each row includes the metadata associated with an m/z value.

elementMetadata:

Contains pixel information in a PositionDataFrame. Each row includes the metadata for a single observation (e.g., a pixel), including specialized slot-columns for tracking pixel coordinates and experimental runs.

metadata:

A list containing experiment-level metadata.

processing:

A SimpleList containing processing steps (including both queued and previously executed processing steps).

centroided:

FALSE if the object contains profile spectra and TRUE if the spectra have been peak-picked and centroided.

Methods

All methods for ImagingExperiment and SparseImagingExperiment also work on MSImagingExperiment objects. Additional methods are documented below:

spectraData(object), spectraData(object) <- value:

Get or set the spectra list (alias for imageData(object)).

spectra(object), spectra(object) <- value:

Get or set the spectra (alias for iData(object)).

mz(object), mz(object) <- value:

Get or set the m/z values from pixelData.

resolution(object), resolution(object) <- value:

Get or set the m/z resolution of the dataset. Typically, this should not be set manually.

centroided(object), centroided(object) <- value:

Get or set the spatial position slot-columns from pixelData.

pixels(object, ..., coord, run):

Returns the row indices of pixelData corresponding to conditions passed via ....

features(object, ..., mz):

Returns the row indices of featureData corresponding to conditions passed via ....

pull(x, ...):

Pull all data elements of imageData into memory as matrices.

peaks(object), peaks(object) <- value:

Attempt to get or set the matrix of peaks. Alias for spectra() if centroided() is TRUE; replacement version also sets centroided to TRUE.

peakData(object), peakData(object) <- value:

Attempt to get or set the underlying m/z and intensity arrays of the peak data in processed experiments. (Currently only implemented for MSProcessedImagingExperiment).

isCentroided(object):

Attempts to infer if the mass spectra are centroided or not (without referencing the centroided slot.

msiInfo(object, ...):

Returns metadata for writing the object to imzML.

rbind(...), cbind(...):

Combine MSImagingExperiment objects by row or column.

Author(s)

Kylie A. Bemis

See Also

ImagingExperiment, SparseImagingExperiment, MSContinuousImagingExperiment, MSProcessedImagingExperiment

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
mz <- mz(from=200, to=220, by=400)
coord <- expand.grid(x=1:3, y=1:3)
data <- matrix(runif(length(mz) * nrow(coord)),
    nrow=length(mz), ncol=nrow(coord))

idata <- ImageArrayList(data)
fdata <- MassDataFrame(mz=mz)
pdata <- PositionDataFrame(coord=coord)

x <- MSImagingExperiment(
    imageData=idata,
    featureData=fdata,
    pixelData=pdata)

print(x)

Example output

Loading required package: BiocGenerics
Loading required package: parallel

Attaching package:BiocGenericsThe following objects are masked frompackage:parallel:

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked frompackage:stats:

    IQR, mad, sd, var, xtabs

The following objects are masked frompackage:base:

    anyDuplicated, append, as.data.frame, basename, cbind, colnames,
    dirname, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
    grepl, intersect, is.unsorted, lapply, Map, mapply, match, mget,
    order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
    rbind, Reduce, rownames, sapply, setdiff, sort, table, tapply,
    union, unique, unsplit, which.max, which.min

Loading required package: BiocParallel
Loading required package: EBImage
Loading required package: S4Vectors
Loading required package: stats4

Attaching package:S4VectorsThe following object is masked frompackage:base:

    expand.grid

Loading required package: ProtGenerics

Attaching package:ProtGenericsThe following object is masked frompackage:stats:

    smooth


Attaching package:CardinalThe following object is masked frompackage:stats:

    filter

An object of class 'MSImagingExperiment'
  <239 feature, 9 pixel> imaging dataset
    imageData(1): data0
    featureData(0):
    pixelData(0):
    run(1): run0
    raster dimensions: 3 x 3
    coord(2): x = 1..3, y = 1..3
    mass range: 200.0000 to 219.9758 
    centroided: FALSE 

Cardinal documentation built on Nov. 8, 2020, 11:10 p.m.