batchProcess-methods {Cardinal} | R Documentation

## Batch Pre-Processing on an Imaging Dataset

### Description

Batch apply multiple pre-processing steps on an imaging dataset.

### Usage

    ## S4 method for signature 'MSImageSet'
    batchProcess(object,
        normalize = NULL,
        smoothSignal = NULL,
        reduceBaseline = NULL,
        reduceDimension = NULL,
        peakPick = NULL,
        peakAlign = NULL,
        ...,
        layout,
        pixel = pixels(object),
        plot = FALSE)

### Arguments

`object` | An object of class `MSImageSet`.
`normalize` | Either 'TRUE' or a `list` of arguments to be passed to the `normalize` method. Use 'FALSE' or 'NULL' to skip this pre-processing step.
`smoothSignal` | Either 'TRUE' or a `list` of arguments to be passed to the `smoothSignal` method. Use 'FALSE' or 'NULL' to skip this pre-processing step.
`reduceBaseline` | Either 'TRUE' or a `list` of arguments to be passed to the `reduceBaseline` method. Use 'FALSE' or 'NULL' to skip this pre-processing step.
`reduceDimension` | Either 'TRUE' or a `list` of arguments to be passed to the `reduceDimension` method. Use 'FALSE' or 'NULL' to skip this pre-processing step.
`peakPick` | Either 'TRUE' or a `list` of arguments to be passed to the `peakPick` method. Use 'FALSE' or 'NULL' to skip this pre-processing step.
`peakAlign` | Either 'TRUE' or a `list` of arguments to be passed to the `peakAlign` method. Use 'FALSE' or 'NULL' to skip this pre-processing step.
`layout` | The layout of the plots, given by a length 2 numeric as `c(ncol, nrow)`.
`pixel` | The pixels to process. If less than the extent of the dataset, this will result in a subset of the data being processed.
`plot` | Plot the pre-processing step for each pixel while it is being processed?
`...` | Ignored.

### Details

One of the primary purposes of this method (besides streamlining pre-processing steps) is to allow single-step reduction of larger-than-memory on-disk datasets to a smaller peak picked form without fully loading the data into memory. Therefore, the behavior for `peakPick` differs somewhat from when the `peakPick` method is called on its own. Typically, the spectra are preserved until `peakAlign` is called. However, to save memory, only the peaks are returned by `batchProcess`.

Additionally, when performing batch pre-processing, the mean spectrum is also calculated and returned as part of the 'featureData' of the result, to be used by subsequent calls to `peakAlign`.

Internally, `pixelApply` is used to apply the pre-processing steps, as with other pre-processing methods.

Note that `reduceDimension` and `peakPick` cannot appear in the same `batchProcess` call together, and `peakAlign` cannot appear in a `batchProcess` call without `peakPick`.

The `peakAlign` step is performed separately from every other step.

### Value

An object of class `MSImageSet` with the processed spectra.

### Author(s)

Kylie A. Bemis

### See Also

`MSImageSet`, `normalize`, `smoothSignal`, `reduceBaseline`, `peakPick`, `pixelApply`

### Examples

    data <- generateImage(as="MSImageSet")

    batchProcess(data, normalize=TRUE, smoothSignal=TRUE,
        reduceBaseline=TRUE, peakPick=TRUE, peakAlign=TRUE,
        layout=c(2,2), plot=interactive())

    batchProcess(data, normalize=TRUE,
        reduceBaseline=list(blocks=200), peakPick=list(SNR=12),
        layout=c(1,3), plot=interactive())

[Package Cardinal version 1.12.1 Index]