OpenMS
FeatureXMLFile Class Reference

This class provides Input/Output functionality for feature maps. More...

#include <OpenMS/FORMAT/FeatureXMLFile.h>

Inheritance diagram for FeatureXMLFile:
[legend]
Collaboration diagram for FeatureXMLFile:
[legend]

Constructors and Destructor

FeatureFileOptions options_
 Options that can be set. More...
 
 FeatureXMLFile ()
 Default constructor. More...
 
 ~FeatureXMLFile () override
 Destructor. More...
 
void load (const String &filename, FeatureMap &feature_map)
 loads the file with name filename into map and calls updateRanges(). More...
 
Size loadSize (const String &filename)
 
void store (const String &filename, const FeatureMap &feature_map)
 stores the map feature_map in file with name filename. More...
 
FeatureFileOptionsgetOptions ()
 Mutable access to the options for loading/storing. More...
 
const FeatureFileOptionsgetOptions () const
 Non-mutable access to the options for loading/storing. More...
 
void setOptions (const FeatureFileOptions &)
 setter for options for loading/storing More...
 

Additional Inherited Members

- Public Types inherited from ProgressLogger
enum  LogType { CMD , GUI , NONE }
 Possible log types. More...
 
- Public Member Functions inherited from XMLFile
 XMLFile ()
 Default constructor. More...
 
 XMLFile (const String &schema_location, const String &version)
 Constructor that sets the schema location. More...
 
virtual ~XMLFile ()
 Destructor. More...
 
bool isValid (const String &filename, std::ostream &os)
 Checks if a file validates against the XML schema. More...
 
const StringgetVersion () const
 return the version of the schema More...
 
- Public Member Functions inherited from ProgressLogger
 ProgressLogger ()
 Constructor. More...
 
virtual ~ProgressLogger ()
 Destructor. More...
 
 ProgressLogger (const ProgressLogger &other)
 Copy constructor. More...
 
ProgressLoggeroperator= (const ProgressLogger &other)
 Assignment Operator. More...
 
void setLogType (LogType type) const
 Sets the progress log that should be used. The default type is NONE! More...
 
LogType getLogType () const
 Returns the type of progress log being used. More...
 
void startProgress (SignedSize begin, SignedSize end, const String &label) const
 Initializes the progress display. More...
 
void setProgress (SignedSize value) const
 Sets the current progress. More...
 
void endProgress () const
 Ends the progress display. More...
 
void nextProgress () const
 increment progress by 1 (according to range begin-end) More...
 
- Protected Member Functions inherited from XMLFile
void parse_ (const String &filename, XMLHandler *handler)
 Parses the XML file given by filename using the handler given by handler. More...
 
void parseBuffer_ (const std::string &buffer, XMLHandler *handler)
 Parses the in-memory buffer given by buffer using the handler given by handler. More...
 
void save_ (const String &filename, XMLHandler *handler) const
 Stores the contents of the XML handler given by handler in the file given by filename. More...
 
void enforceEncoding_ (const String &encoding)
 
- Static Protected Member Functions inherited from ProgressLogger
static String logTypeToFactoryName_ (LogType type)
 Return the name of the factory product used for this log type. More...
 
- Protected Attributes inherited from XMLFile
String schema_location_
 XML schema file location. More...
 
String schema_version_
 Version string. More...
 
String enforced_encoding_
 Encoding string that replaces the encoding (system dependent or specified in the XML). Disabled if empty. Used as a workaround for XTandem output xml. More...
 
- Protected Attributes inherited from ProgressLogger
LogType type_
 
time_t last_invoke_
 
ProgressLoggerImplcurrent_logger_
 
- Static Protected Attributes inherited from ProgressLogger
static int recursion_depth_
 

Detailed Description

This class provides Input/Output functionality for feature maps.

A documented schema for this format can be found at https://github.com/OpenMS/OpenMS/tree/develop/share/OpenMS/SCHEMAS

Todo:
Take care that unique ids are assigned properly by TOPP tools before calling FeatureXMLFile::store(). There will be a message on OPENMS_LOG_INFO but we will make no attempt to fix the problem in this class. (all developers)
Note
This format will eventually be replaced by the HUPO-PSI AnalysisXML (mzIdentML and mzQuantML) formats!

Constructor & Destructor Documentation

◆ FeatureXMLFile()

Default constructor.

◆ ~FeatureXMLFile()

~FeatureXMLFile ( )
override

Destructor.

Member Function Documentation

◆ getOptions() [1/2]

FeatureFileOptions& getOptions ( )

Mutable access to the options for loading/storing.

◆ getOptions() [2/2]

const FeatureFileOptions& getOptions ( ) const

Non-mutable access to the options for loading/storing.

◆ load()

void load ( const String filename,
FeatureMap feature_map 
)

loads the file with name filename into map and calls updateRanges().

Exceptions
Exception::FileNotFoundis thrown if the file could not be opened
Exception::ParseErroris thrown if an error occurs during parsing

Referenced by TOPPViewBase::addDataFile().

◆ loadSize()

Size loadSize ( const String filename)

◆ setOptions()

void setOptions ( const FeatureFileOptions )

setter for options for loading/storing

◆ store()

void store ( const String filename,
const FeatureMap feature_map 
)

stores the map feature_map in file with name filename.

Exceptions
Exception::UnableToCreateFileis thrown if the file could not be created

Member Data Documentation

◆ options_

FeatureFileOptions options_
protected

Options that can be set.