flatten: Flatten, or re-read, MassBank header blocks

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

View source: R/createMassBank.R

Description

flatten converts a list of MassBank compound information sets (as retrieved by gatherData) to a flat table, to be exported into an infolist. readMbdata reads a single record from an infolist flat table back into a MassBank (half-)entry.

Usage

1
2
3

Arguments

mbdata

A list of MassBank compound information sets as returned from gatherData.

row

One row of MassBank compound information retrieved from an infolist.

Details

Neither the flattening system itself nor the implementation are particularly fantastic, but since hand-checking of records is a necessary evil, there is currently no alternative (short of coding a complete GUI for this and working directly on the records.)

Value

flatten returns a matrix (not a data frame) to be written to CSV.

readMbdata returns a list of type list(id= compoundID, ..., 'ACCESSION' = '', 'RECORD_TITLE' = '', ) etc.

Author(s)

Michael Stravs

References

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

See Also

gatherData,loadInfolist

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
	# Collect some data to flatten
	ids <- c(40,50,60,70)
 data <- lapply(ids, gatherData)
 # Flatten the data trees to a table
 flat.table <- flatten(data)
 # reimport the table into a tree
 data.reimported <- apply(flat.table, 1, readMbdata)

## End(Not run)

RMassBank documentation built on Nov. 8, 2020, 6:06 p.m.