getAnalyticalInfo {RMassBank} | R Documentation

## Compose data block of MassBank record

### Description

`gatherCompound` composes the data blocks (the "lower half") of all MassBank records for a compound, using the annotation data in the RMassBank options, spectrum info data from the `analyzedSpec`-type record and the peaks from the reanalyzed, multiplicity-filtered peak table. It calls `gatherSpectrum` for each child spectrum.

### Usage

    gatherCompound(spec, aggregated, additionalPeaks = NULL, retrieval="standard")

    		gatherSpectrum(spec, msmsdata, ac_ms, ac_lc, aggregated,
     		additionalPeaks = NULL, retrieval="standard")

### Arguments

`spec` | A `RmbSpectraSet` object, representing a compound with multiple spectra.
`aggregated` | An aggregate peak table where the peaks are extracted from.
`msmsdata` | A `RmbSpectrum2` object from the `spec` spectra set, representing a single spectrum to give a record.
`ac_ms, ac_lc` | Information for the AC\$MASS_SPECTROMETRY and AC\$CHROMATOGRAPHY fields in the MassBank record, created by `gatherCompound` and then fed into `gatherSpectrum`.
`additionalPeaks` | If present, a table with additional peaks to add into the spectra. As loaded with `addPeaks`.
`retrieval` | A value that determines whether the files should be handled either as "standard", if the compoundlist is complete, "tentative", if at least a formula is present or "unknown" if the only know thing is the m/z

### Details

The returned data blocks are in format `list( "AC\$MASS_SPECTROMETRY" = list('FRAGMENTATION_MODE' = 'CID', ...), ...)` etc.

### Value

`gatherCompound` returns a list of tree-like MassBank data blocks. `gatherSpectrum` returns one single MassBank data block or `NA` if no useful peak is in the spectrum.

### Note

Note that the global table `additionalPeaks` is also used as an additional source of peaks.

### Author(s)

Michael Stravs

### References

MassBank record format: http://www.massbank.jp/manuals/MassBankRecord_en.pdf

### See Also

`mbWorkflow`, `compileRecord`

### Examples

    ## Not run:
         myspectrum <- w@spectra[[1]]
    		massbankdata <- gatherCompound(myspectrum, w@aggregated)
    		# Note: ac_lc and ac_ms are data blocks usually generated in gatherCompound and
    		# passed on from there. The call below gives a relatively useless result :)
    		ac_lc_dummy <- list()
    		ac_ms_dummy <- list()
    		justOneSpectrum <- gatherSpectrum(myspectrum, myspectrum@child[[2]],
    			ac_ms_dummy, ac_lc_dummy, w@aggregated)

    ## End(Not run)

[Package RMassBank version 3.2.0 Index]