compileRecord: Compile MassBank records

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/createMassBank.R

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

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

Arguments

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.)

mbdata

The information data block for the record header, as stored in mbdata_relisted after loading an infolist.

aggregated

An aggregated peak data table containing information about refiltered spectra etc.

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

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

1
2
3
4
5
#
## 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)

RMassBank documentation built on May 31, 2017, 11:21 a.m.