flatten {RMassBank} | R Documentation |
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.
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
## 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)