Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/createMassBank.R
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.
1 2 3  | flatten(mbdata) 
readMbdata(row)
 | 
mbdata | 
 A list of MassBank compound information sets as returned from
  | 
row | 
 One row of MassBank compound information retrieved from an infolist.  | 
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.)
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.
Michael Stravs
MassBank record format: http://www.massbank.jp/manuals/MassBankRecord_en.pdf
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)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.