All classes for file and database IO can be found in the FORMAT folder.
The interface of most file adapter classes is very similar. They implement a load and a store method, that take a file name and the appropriate data structure.
The following example (Tutorial_FileIO.C) demonstrates the use of MzMLFile and MzXMLFile to convert one format into another using MSExperiment to hold the temporary data:
Int main() { MzXMLFile mzxml; MzMLFile mzml; // temporary data storage MSExperiment<Peak1D> map; // convert MzXML to MzML mzxml.load("data/Tutorial_FileIO.mzXML", map); mzml.store("output/Tutorial_FileIO.mzML", map); return 0; } //end of main
MSExperiment<> in;
FileHandler handler();
handler.loadExperiment("input.mzML",in);
For database access, the class DBAdapter is used. As its interface is very similar to the interface of the file adapters, no example is shown here.
In order to have more control over loading data from files or databases, most adapters can be configured using PeakFileOptions. The following options are available:
| OpenMS / TOPP release 1.10.0 | Documentation generated on Thu Mar 7 2013 09:42:47 using doxygen 1.7.1 |