Skip to main content
Topic: parser for massbank record --> R (list) (Read 768 times) previous topic - next topic

parser for massbank record --> R (list)

RMassBank first creates a list structure for the info that goes in the RMassBank record, but is there a way to go the other way?
--> A parser to read the RMassBank txt files into an R friendly structure.
Blog: stanstrup.github.io

Re: parser for massbank record --> R (list)

Reply #1
The newest, cutting edge RMassBank version does this.

install_github("MassBank/RMassBank@s4power")
RMassBank:::parseMbRecord(filename)
parses a massbank record to  a RmbSpectrum2 object
RMassBank:::parseMbRecords(filenames)
parses multiple files into a list of RmbSpectraSet objects (i.e. it groups the spectra by compound)

(yes it's not even exported yet - I just wrote it a week ago. Also, in the older RMassBank versions, there is parseMassBank which also parses MassBank records, but not into the "native" RMassBank/MSnbase format. parseMassBank will be replaced by parseMbRecord(s) soon, i.e. parseMbRecord(s) will be renamed to parseMassBank and will be an S4 method.)