.buildRecord.RmbSpectraSet {RMassBank} | R Documentation

## Compile MassBank records

### Description

Takes a spectra block for a compound, as returned from `analyzeMsMs`, and an aggregated cleaned peak table, together with a MassBank information block, as stored in the infolists and loaded via `loadInfolist`/`readMbdata` and processes them to a MassBank record

### Usage

    compileRecord(spec, mbdata, aggregated, additionalPeaks = NULL, retrieval="standard")

### Arguments

`mbdata` | The information data block for the record header, as stored in `mbdata_relisted` after loading an infolist.
`additionalPeaks` | If present, a table with additional peaks to add into the spectra. As loaded with `addPeaks`.
`spec` | A `RmbSpectraSet` for a compound, after analysis (`analyzeMsMs`). Note that peaks are not read from this object anymore: Peaks come from the `aggregated` dataframe (and from the global `additionalPeaks` dataframe; cf. `addPeaks` for usage information.)
`aggregated` | An aggregated peak data table containing information about refiltered spectra etc.
`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

`compileRecord` calls `gatherCompound` to create blocks of spectrum data, and finally fills in the record title and accession number, renames the "internal ID" comment field and removes dummy fields.

### Value

Returns a MassBank record in list format: e.g. `list("ACCESSION" = "XX123456", "RECORD_TITLE" = "Cubane", ..., "CH\$LINK" = list( "CAS" = "12-345-6", "CHEMSPIDER" = 1111, ...))`

### Author(s)

Michael Stravs

### References

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

### See Also

`mbWorkflow`, `addPeaks`, `gatherCompound`, `toMassbank`

### Examples

    #
    ## Not run: myspec <- w@spectra[[2]]
    # after having loaded an infolist:
    ## Not run: mbdata <- mbdata_relisted[[which(mbdata_archive\$id == as.numeric(myspec\$id))]]
    ## Not run: compiled <- compileRecord(myspec, mbdata, w@aggregated)

[Package RMassBank version 3.2.0 Index]