-
Notifications
You must be signed in to change notification settings - Fork 12
Parser libraries
Parser Libraries
Currently, the jmzReader library contains parsers for 6 peak list formats:
- dta-parser
- mgf-parser
- ms2-parser
- mzdata-parser
- mzxml-parser
- pkl-parser
- mzml-wrapper
- pride-wrapper
All of these parsers implement the jmzReader interface. Thereby, developers can easily develop software supporting a multitude of peak list formats without the need to adapt their code.
#Details
The jmzReader library consists of multiple parser libraries. All of these parser libraries can be used separately but also implement a common interface. The supported file formats provide varying levels of meta-data (non as for example in pkl and dta files and very extensive as in mzData and mzXML).
The common interface implemented by all parsers was therefore designed to only provide access to the core information found in all the files: the peak lists as well as basic information about the precursor ion's state. To access the more detailed, file format specific data every parser library provides access to a file format specific, easy-to-use, Java object model that contains the complete information found in the file.
#Pre-Indexing files
All parser libraries support the pre-indexing of files. Once a file is loaded every parser provides access to functions that retrieve the position of a given spectrum in the file. getMsNIndexes(int msLevel) returns a list of IndexElements? that contain the location of the spectra (with the given MS level) in the order they are found in the parsed MS data file. getIndexElementForIds() on the other hand returns a Map with the spectrum's id as key and its position information contained in an IndexElement? as value. Thereby, it is possible to store the positional information of any spectrum in an optimized way (f.e. in a database). To access spectra who's position in the file is already known every parser provides the static function getIndexedSpectrum(File sourcefile, IndexElement? indexElement). This function returns a spectrum from the given file at the position defined by the passed IndexElement?. When using this static method the file is not indexed or prescanned thus allowing fast access to any spectrum.
#Peak List Parser GUI
The jmzReader-Gui is a simple tool to demonstrate the use of the jmzReader interface. It can be used to visualize all of the supported peak list formats as well as to convert them into MGF files.