OpenMS
Loading...
Searching...
No Matches
MascotXMLFile Class Reference

Used to load Mascot XML files. More...

#include <OpenMS/FORMAT/MascotXMLFile.h>

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

Public Member Functions

 MascotXMLFile ()
 Constructor.
 
void load (const std::string &filename, ProteinIdentification &protein_identification, PeptideIdentificationList &id_data, const SpectrumMetaDataLookup &lookup)
 Loads data from a Mascot XML file.
 
void load (const std::string &filename, ProteinIdentification &protein_identification, PeptideIdentificationList &id_data, std::map< std::string, std::vector< AASequence > > &peptides, const SpectrumMetaDataLookup &lookup)
 Loads data from a Mascot XML file.
 
- 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.
 

Static Public Member Functions

static void initializeLookup (SpectrumMetaDataLookup &lookup, const PeakMap &experiment, const std::string &scan_regex="")
 Initializes a helper object for looking up spectrum meta data (RT, m/z)
 

Additional Inherited Members

- 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.
 
- 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.
 

Detailed Description

Used to load Mascot XML files.

This class is used to load documents that implement the schema of Mascot XML files.

Constructor & Destructor Documentation

◆ MascotXMLFile()

Constructor.

Member Function Documentation

◆ initializeLookup()

static void initializeLookup ( SpectrumMetaDataLookup lookup,
const PeakMap experiment,
const std::string &  scan_regex = "" 
)
static

Initializes a helper object for looking up spectrum meta data (RT, m/z)

Parameters
[in]lookupHelper object to initialize
[in]experimentExperiment containing the spectra
[in]scan_regexOptional regular expression for extracting information from references to spectra

◆ load() [1/2]

void load ( const std::string &  filename,
ProteinIdentification protein_identification,
PeptideIdentificationList id_data,
const SpectrumMetaDataLookup lookup 
)

Loads data from a Mascot XML file.

Parameters
[in]filenamethe file to be loaded
[in]protein_identificationprotein identifications belonging to the whole experiment
[in]id_datathe identifications with m/z and RT
[in]lookuphelper object for looking up spectrum meta data
Exceptions
Exception::FileNotFoundis thrown if the file does not exists.
Exception::ParseErroris thrown if the file does not suit to the standard.

◆ load() [2/2]

void load ( const std::string &  filename,
ProteinIdentification protein_identification,
PeptideIdentificationList id_data,
std::map< std::string, std::vector< AASequence > > &  peptides,
const SpectrumMetaDataLookup lookup 
)

Loads data from a Mascot XML file.

Parameters
[in]filenamethe file to be loaded
[in]protein_identificationprotein identifications belonging to the whole experiment
[in]id_datathe identifications with m/z and RT
[in,out]peptidesa map of modified peptides identified by the std::string title
[in]lookuphelper object for looking up spectrum meta data
Exceptions
Exception::FileNotFoundis thrown if the file does not exists.
Exception::ParseErroris thrown if the file does not suit to the standard.