| OpenMS 2.5.0

Public Member Functions | List of all members
MzIdentMLFile Class Reference
Format » File IO

File adapter for MzIdentML files. More...

`#include <OpenMS/FORMAT/MzIdentMLFile.h>`

Inheritance diagram for MzIdentMLFile:

## Public Member Functions

| MzIdentMLFile ()
| Default constructor. More...
| ~MzIdentMLFile () override
| Destructor. More...
void | load (const String &filename, std::vector< ProteinIdentification > &poid, std::vector< PeptideIdentification > &peid)
| Loads the identifications from a MzIdentML file. More...
void | store (const String &filename, const std::vector< ProteinIdentification > &poid, const std::vector< PeptideIdentification > &peid) const
| Stores the identifications in a MzIdentML file. More...
void | store (const String &filename, const Identification &id) const
| Stores the identifications in a MzIdentML file. More...
bool | isSemanticallyValid (const String &filename, StringList &errors, StringList &warnings)
| Checks if a file is valid with respect to the mapping file and the controlled vocabulary. 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 String & | getVersion () const
| return the version of the schema More...
Public Member Functions inherited from ProgressLogger
| ProgressLogger ()
| Constructor. More...
| ~ProgressLogger ()
| Destructor. More...
| ProgressLogger (const ProgressLogger &other)
| Copy constructor. More...
ProgressLogger & | operator= (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...

## Additional Inherited Members

Public Types inherited from ProgressLogger
enum | LogType { CMD, GUI, NONE }
| Possible log types. 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_
ProgressLoggerImpl * | current_logger_
Static Protected Attributes inherited from ProgressLogger
static int | recursion_depth_

## Detailed Description

File adapter for MzIdentML files.

This file adapter exposes the internal MzIdentML processing capabilities to the library. The file adapter interface is kept the same as idXML file adapter for downward capability reasons. For now, read-in will be performed with DOM write-out with STREAM

Note
  due to the limited capabilities of idXML/PeptideIdentification/ProteinIdentification not all MzIdentML features can be supported. Development for these structures will be discontinued, a new interface with appropriate structures will be provided.
  If a critical error occurs due to the missing functionality, Exception::NotImplemented is thrown.
  All PSM will be read into PeptideIdentification, even the passThreshold=false, threshold will be read into ProteinIdentification (i.e. one id run), considered at writing also will only be the threshold set in ProteinIdentification
  All PSM will be read into PeptideIdentification, even the passThreshold=false

## Constructor & Destructor Documentation

## ◆ MzIdentMLFile()

MzIdentMLFile | ( |  | ) |

Default constructor.

## ◆ ~MzIdentMLFile()

~MzIdentMLFile | ( |  | ) |

override

Destructor.

## Member Function Documentation

## ◆ isSemanticallyValid()

bool isSemanticallyValid | ( | const String & | filename,
|  | StringList & | errors,
|  | StringList & | warnings
| ) |  |

Checks if a file is valid with respect to the mapping file and the controlled vocabulary.

Parameters

  filename | File name of the file to be checked.
  errors | Errors during the validation are returned in this output parameter.
  warnings | Warnings during the validation are returned in this output parameter.

Exceptions

  Exception::FileNotFound | is thrown if the file could not be opened

## ◆ load()

void load | ( | const String & | filename,
|  | std::vector< ProteinIdentification > & | poid,
|  | std::vector< PeptideIdentification > & | peid
| ) |  |

Loads the identifications from a MzIdentML file.

Exceptions

  Exception::FileNotFound | is thrown if the file could not be opened
  Exception::ParseError | is thrown if an error occurs during parsing

Referenced by TOPPViewBase::addDataFile(), and TOPPViewBase::annotateWithID().

## ◆ store() [1/2]

void store | ( | const String & | filename,
|  | const std::vector< ProteinIdentification > & | poid,
|  | const std::vector< PeptideIdentification > & | peid
| ) |  | const

Stores the identifications in a MzIdentML file.

Exceptions

  Exception::UnableToCreateFile | is thrown if the file could not be created

## ◆ store() [2/2]

void store | ( | const String & | filename,
|  | const Identification & | id
| ) |  | const

Stores the identifications in a MzIdentML file.

Exceptions

  Exception::UnableToCreateFile | is thrown if the file could not be created