![]() |
OpenMS
|
File adapter for MzXML 3.1 files. More...
#include <OpenMS/FORMAT/MzXMLFile.h>
Public Member Functions | |
| MzXMLFile () | |
| Default constructor. | |
| ~MzXMLFile () override | |
| Destructor. | |
| PeakFileOptions & | getOptions () |
| Mutable access to the options for loading/storing. | |
| const PeakFileOptions & | getOptions () const |
| Non-mutable access to the options for loading/storing. | |
| void | setOptions (const PeakFileOptions &) |
| set options for loading/storing | |
| void | load (const std::string &filename, MapType &map) |
| Loads a map from a MzXML file. | |
| void | store (const std::string &filename, const MapType &map) const |
| Stores a map in a MzXML file. | |
| void | transform (const std::string &filename_in, Interfaces::IMSDataConsumer *consumer, bool skip_full_count=false) |
| Transforms a map while loading using the supplied MSDataConsumer. | |
| void | transform (const std::string &filename_in, Interfaces::IMSDataConsumer *consumer, MapType &map, bool skip_full_count=false) |
| Transforms a map while loading using the supplied MSDataConsumer. | |
Public Member Functions inherited from XMLFile | |
| XMLFile () | |
Construct an XMLFile without schema info; schema_location_ remains unset, so isValid cannot be used until derived-class logic initializes schema_location_ before calling isValid. | |
| XMLFile (const std::string &schema_location, const std::string &version) | |
| Construct with a schema location for later isValid calls. | |
| virtual | ~XMLFile () |
| Virtual destructor — defaulted; allows safe deletion through a base-class pointer. | |
| bool | isValid (const std::string &filename, std::ostream &os) |
Check if filename validates against the bound XML schema. | |
| const std::string & | getVersion () const |
| Return the schema version string passed to the parameterised constructor; empty for default-constructed instances. | |
Public Member Functions inherited from ProgressLogger | |
| ProgressLogger () | |
| Constructor. | |
| virtual | ~ProgressLogger () |
| Destructor. | |
| ProgressLogger (const ProgressLogger &other) | |
| Copy constructor. | |
| ProgressLogger & | operator= (const ProgressLogger &other) |
| Assignment Operator. | |
| void | setLogType (LogType type) const |
| Sets the progress log that should be used. The default type is NONE! | |
| LogType | getLogType () const |
| Returns the type of progress log being used. | |
| void | setLogger (ProgressLoggerImpl *logger) |
| Sets the logger to be used for progress logging. | |
| void | startProgress (SignedSize begin, SignedSize end, const std::string &label) const |
| Initializes the progress display. | |
| void | setProgress (SignedSize value) const |
| Sets the current progress. | |
| void | endProgress (UInt64 bytes_processed=0) const |
| void | nextProgress () const |
| increment progress by 1 (according to range begin-end) | |
Protected Member Functions | |
| void | transformFirstPass_ (const std::string &filename_in, Interfaces::IMSDataConsumer *consumer, bool skip_full_count) |
| Perform first pass through the file and retrieve the meta-data to initialize the consumer. | |
Protected Member Functions inherited from XMLFile | |
| void | parse_ (const std::string &filename, XMLHandler *handler) |
Parse the XML file at filename through handler. | |
| void | parseBuffer_ (const std::string &buffer, XMLHandler *handler) |
Parse an in-memory XML buffer through handler. | |
| void | save_ (const std::string &filename, XMLHandler *handler) const |
Stores the contents of the XML handler given by handler in the file given by filename. | |
| void | enforceEncoding_ (const std::string &encoding) |
| Set or clear the XML-encoding override applied to subsequent parse_ / parseBuffer_ calls. | |
Private Types | |
| typedef PeakMap | MapType |
Private Attributes | |
| PeakFileOptions | options_ |
Additional Inherited Members | |
Public Types inherited from ProgressLogger | |
| enum | LogType { CMD , GUI , NONE } |
| Possible log types. More... | |
Protected Attributes inherited from XMLFile | |
| std::string | schema_location_ |
Path of the XML schema for validation; empty when the default constructor was used (isValid then throws NotImplemented). | |
| std::string | schema_version_ |
| Schema version string returned by getVersion. | |
| std::string | enforced_encoding_ |
Optional XML encoding override applied to the InputSource in parse_ and parseBuffer_; empty disables the override. Used as a workaround for XTandem output XML which carries an encoding the parser otherwise stumbles on. | |
Protected Attributes inherited from ProgressLogger | |
| LogType | type_ |
| time_t | last_invoke_ |
| ProgressLoggerImpl * | current_logger_ |
Static Protected Attributes inherited from ProgressLogger | |
| static int | recursion_depth_ |
File adapter for MzXML 3.1 files.
| MzXMLFile | ( | ) |
Default constructor.
|
override |
Destructor.
| PeakFileOptions & getOptions | ( | ) |
Mutable access to the options for loading/storing.
| const PeakFileOptions & getOptions | ( | ) | const |
Non-mutable access to the options for loading/storing.
| void load | ( | const std::string & | filename, |
| MapType & | map | ||
| ) |
Loads a map from a MzXML file.
map has to be a MSExperiment or have the same interface.
| Exception::FileNotFound | is thrown if the file could not be opened |
| Exception::ParseError | is thrown if an error occurs during parsing |
| void setOptions | ( | const PeakFileOptions & | ) |
set options for loading/storing
| void store | ( | const std::string & | filename, |
| const MapType & | map | ||
| ) | const |
Stores a map in a MzXML file.
map has to be a MSExperiment or have the same interface.
| Exception::UnableToCreateFile | is thrown if the file could not be created |
| void transform | ( | const std::string & | filename_in, |
| Interfaces::IMSDataConsumer * | consumer, | ||
| bool | skip_full_count = false |
||
| ) |
Transforms a map while loading using the supplied MSDataConsumer.
The result will not be stored directly but is available through the events triggered by the parser and caught by the provided IMSDataConsumer object.
This function should be used if processing and storage of the result can be performed directly in the provided IMSDataConsumer object.
| [in] | filename_in | Filename of input mzML file to transform |
| [in] | consumer | Consumer class to operate on the input filename (implementing a transformation) |
| [in] | skip_full_count | Whether to skip computing the correct number of spectra and chromatograms in the input file |
| void transform | ( | const std::string & | filename_in, |
| Interfaces::IMSDataConsumer * | consumer, | ||
| MapType & | map, | ||
| bool | skip_full_count = false |
||
| ) |
Transforms a map while loading using the supplied MSDataConsumer.
The result will be stored in the provided map.
This function should be used if a specific pre-processing should be applied to the data before storing them in a map (e.g. if data-reduction should be applied to the data before loading all data into memory).
| [in] | filename_in | Filename of input mzXML file to transform |
| [in] | consumer | Consumer class to operate on the input filename (implementing a transformation) |
| [out] | map | Map to store the resulting spectra and chromatograms |
| [in] | skip_full_count | Whether to skip computing the correct number of spectra and chromatograms in the input file |
|
protected |
Perform first pass through the file and retrieve the meta-data to initialize the consumer.
|
private |