aggregateSpectra {RMassBank} | R Documentation

## Aggregate analyzed spectra

### Description

Groups an array of analyzed spectra and creates aggregated peak tables

### Usage

    aggregateSpectra(spec,  addIncomplete=FALSE)

### Arguments

`spec` | The `RmbSpectraSetList` of spectra sets (`RmbSpectraSet` objects) to aggregate
`addIncomplete` | Whether or not the peaks from incomplete files (files for which less than the maximal number of spectra are present)

### Details

`addIncomplete` is relevant for recalibration. For recalibration, we want to use only high-confidence peaks, therefore we set `addIncomplete` to `FALSE`. When we want to generate a peak list for actually generating MassBank records, we want to include all peaks into the peak tables.

### Value

A summary `data.frame` with all peaks (possibly multiple rows for one m/z value from a spectrum, see below) with columns:

`mzFound, intensity` | Mass and intensity of the peak
`good` | if the peak passes filter criteria
`mzCalc, formula, dbe, dppm` | calculated mass, formula, dbe and ppm deviation of the assigned formula
`formulaCount, dppmBest` | Number of matched formulae for this m/z value, and ppm deviation of the best match
`scan, cpdID, parentScan` | Scan number of the child and parent spectrum in the raw file, also the compound ID to which the peak belongs
`dppmRc` | ppm deviation recalculated from the aggregation function
`index` | Aggregate-table peak index, so the table can be subsetted, edited and results reinserted back into this table easily

Further columns are later added by workflow steps 6 (electronic noise culler), 7 and 8.

### Author(s)

Michael Stravs

### See Also

`msmsWorkflow`, `analyzeMsMs`

### Examples

    ## As used in the workflow:
    ## Not run: %
    	w@spectra <- lapply(w@spectra, function(spec)
    		analyzeMsMs(spec, mode="pH", detail=TRUE, run="recalibrated", cut=0, cut_ratio=0 ) )
    	w@aggregate <- aggregateSpectra(w@spectra)

    ## End(Not run)

[Package RMassBank version 3.2.0 Index]