Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
File and DB access

All classes for file and database IO can be found in the FORMAT folder.

File adapter classes

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

FileHandler
In order to make the handling of different file types easier, the class FileHandler can be used. It loads a file into the appropriate data structure independently of the file type. The file type is determined from the file extension or the file contents:
MSExperiment<> in;
FileHandler handler();
handler.loadExperiment("input.mzML",in);

DB access

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.

PeakFileOptions

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.9.0 Documentation generated on Sun Oct 27 2013 01:11:37 using doxygen 1.8.4