Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
XQuestResultXMLHandler Class Reference

XMLHandler for the result files of XQuest. More...

#include <OpenMS/FORMAT/HANDLERS/XQuestResultXMLHandler.h>

Inheritance diagram for XQuestResultXMLHandler:
XMLHandler

Public Member Functions

 XQuestResultXMLHandler (const String &filename, std::vector< std::vector< PeptideIdentification > > &csms, std::vector< ProteinIdentification > &prot_ids, Size min_n_ions_per_spectrum, bool load_to_peptideHit_)
 
virtual ~XQuestResultXMLHandler ()
 
void endElement (const XMLCh *const uri, const XMLCh *const local_name, const XMLCh *const qname)
 Parsing method for closing tags. More...
 
void startElement (const XMLCh *const uri, const XMLCh *const local_name, const XMLCh *const qname, const xercesc::Attributes &attributes)
 Parsing method for opening tags. More...
 
double getMinScore () const
 Returns the minimum score encountered in the file. More...
 
double getMaxScore () const
 Returns the maximum score encountered in the file. More...
 
UInt getNumberOfHits () const
 Returns the total number of hits in the file. More...
 
- Public Member Functions inherited from XMLHandler
 XMLHandler (const String &filename, const String &version)
 Default constructor. More...
 
virtual ~XMLHandler ()
 Destructor. More...
 
void reset ()
 Release internal memory used for parsing (call. More...
 
void fatalError (ActionMode mode, const String &msg, UInt line=0, UInt column=0) const
 Fatal error handler. Throws a ParseError exception. More...
 
void error (ActionMode mode, const String &msg, UInt line=0, UInt column=0) const
 Error handler for recoverable errors. More...
 
void warning (ActionMode mode, const String &msg, UInt line=0, UInt column=0) const
 Warning handler. More...
 
virtual void characters (const XMLCh *const chars, const XMLSize_t length)
 Parsing method for character data. More...
 
virtual void writeTo (std::ostream &)
 Writes the contents to a stream. More...
 
String errorString ()
 Returns the last error description. More...
 
void fatalError (const xercesc::SAXParseException &exception)
 
void error (const xercesc::SAXParseException &exception)
 
void warning (const xercesc::SAXParseException &exception)
 

Static Public Attributes

static std::map< Size, Stringenzymes
 
static std::map< String, UIntmonths
 
static const String decoy_string
 

Private Member Functions

void extractDateTime_ (const String &xquest_datetime_string, DateTime &date_time)
 Extracts the DateTime from datetime string from xQuest. More...
 
void addMetaValues_ (MetaInfoInterface &meta_info_interface)
 Assignes all meta values stored in the peptide_id_attributes member to an meta info interface. More...
 
void getLinkPosition_ (const xercesc::Attributes &attributes, std::pair< SignedSize, SignedSize > &pair)
 Gets the link location of a xQuest xlinkPositionString. More...
 
void setPeptideEvidence_ (const String &prot_string, PeptideHit &pep_hit)
 Sets the peptide evidence for Alpha and Beta. More...
 
void setMetaValue_ (const String &key, const DataValue &datavalue, PeptideIdentification &pep_id, PeptideHit &alpha)
 Sets the meta value of the peptide identification for alpha hit. More...
 
void setMetaValue_ (const String &key, const DataValue &datavalue, PeptideIdentification &pep_id, PeptideHit &alpha, PeptideHit &beta)
 Sets the meta value of the peptide identification for alpha hit. More...
 

Private Attributes

std::vector< std::vector< PeptideIdentification > > & csms_
 
std::vector< ProteinIdentification > & prot_ids_
 
UInt n_hits_
 
double min_score_
 
double max_score_
 
Size min_n_ions_per_spectrum_
 
bool load_to_peptideHit_
 
bool is_openproxl_
 
std::set< Stringaccessions_
 
EnzymesDBenzymes_db_
 
std::set< UIntcharges_
 
UInt min_precursor_charge_
 
UInt max_precursor_charge_
 
double rt_light_
 
std::set< doublemonolinks_masses_
 
std::vector< PeptideIdentificationcurrent_spectrum_search_
 
std::map< String, DataValuepeptide_id_meta_values_
 

Additional Inherited Members

- Public Types inherited from XMLHandler
enum  ActionMode { LOAD, STORE }
 Action to set the current mode (for error messages) More...
 
- Static Public Member Functions inherited from XMLHandler
static String writeXMLEscape (const String &to_escape)
 Escapes a string and returns the escaped string. More...
 
- Protected Member Functions inherited from XMLHandler
bool equal_ (const XMLCh *a, const XMLCh *b) const
 Returns if two Xerces strings are equal. More...
 
void writeUserParam_ (const String &tag_name, std::ostream &os, const MetaInfoInterface &meta, UInt indent) const
 Writes the content of MetaInfoInterface to the file. More...
 
Int asInt_ (const String &in)
 Conversion of a String to an integer value. More...
 
Int asInt_ (const XMLCh *in)
 Conversion of a Xerces string to an integer value. More...
 
UInt asUInt_ (const String &in)
 Conversion of a String to an unsigned integer value. More...
 
double asDouble_ (const String &in)
 Conversion of a String to a double value. More...
 
float asFloat_ (const String &in)
 Conversion of a String to a float value. More...
 
bool asBool_ (const String &in)
 Conversion of a string to a boolean value. More...
 
DateTime asDateTime_ (String date_string)
 Conversion of a xs:datetime string to a DateTime value. More...
 
char * attributeAsString_ (const xercesc::Attributes &a, const char *name) const
 Converts an attribute to a String. More...
 
Int attributeAsInt_ (const xercesc::Attributes &a, const char *name) const
 Converts an attribute to a Int. More...
 
double attributeAsDouble_ (const xercesc::Attributes &a, const char *name) const
 Converts an attribute to a double. More...
 
DoubleList attributeAsDoubleList_ (const xercesc::Attributes &a, const char *name) const
 Converts an attribute to a DoubleList. More...
 
IntList attributeAsIntList_ (const xercesc::Attributes &a, const char *name) const
 Converts an attribute to an IntList. More...
 
StringList attributeAsStringList_ (const xercesc::Attributes &a, const char *name) const
 Converts an attribute to an StringList. More...
 
bool optionalAttributeAsString_ (String &value, const xercesc::Attributes &a, const char *name) const
 Assigns the attribute content to the String value if the attribute is present. More...
 
bool optionalAttributeAsInt_ (Int &value, const xercesc::Attributes &a, const char *name) const
 Assigns the attribute content to the Int value if the attribute is present. More...
 
bool optionalAttributeAsUInt_ (UInt &value, const xercesc::Attributes &a, const char *name) const
 Assigns the attribute content to the UInt value if the attribute is present. More...
 
bool optionalAttributeAsDouble_ (double &value, const xercesc::Attributes &a, const char *name) const
 Assigns the attribute content to the double value if the attribute is present. More...
 
bool optionalAttributeAsDoubleList_ (DoubleList &value, const xercesc::Attributes &a, const char *name) const
 Assigns the attribute content to the DoubleList value if the attribute is present. More...
 
bool optionalAttributeAsStringList_ (StringList &value, const xercesc::Attributes &a, const char *name) const
 Assigns the attribute content to the StringList value if the attribute is present. More...
 
bool optionalAttributeAsIntList_ (IntList &value, const xercesc::Attributes &a, const char *name) const
 Assigns the attribute content to the IntList value if the attribute is present. More...
 
char * attributeAsString_ (const xercesc::Attributes &a, const XMLCh *name) const
 Converts an attribute to a String. More...
 
Int attributeAsInt_ (const xercesc::Attributes &a, const XMLCh *name) const
 Converts an attribute to a Int. More...
 
double attributeAsDouble_ (const xercesc::Attributes &a, const XMLCh *name) const
 Converts an attribute to a double. More...
 
DoubleList attributeAsDoubleList_ (const xercesc::Attributes &a, const XMLCh *name) const
 Converts an attribute to a DoubleList. More...
 
IntList attributeAsIntList_ (const xercesc::Attributes &a, const XMLCh *name) const
 Converts an attribute to a IntList. More...
 
StringList attributeAsStringList_ (const xercesc::Attributes &a, const XMLCh *name) const
 Converts an attribute to a StringList. More...
 
bool optionalAttributeAsString_ (String &value, const xercesc::Attributes &a, const XMLCh *name) const
 Assigns the attribute content to the String value if the attribute is present. More...
 
bool optionalAttributeAsInt_ (Int &value, const xercesc::Attributes &a, const XMLCh *name) const
 Assigns the attribute content to the Int value if the attribute is present. More...
 
bool optionalAttributeAsUInt_ (UInt &value, const xercesc::Attributes &a, const XMLCh *name) const
 Assigns the attribute content to the UInt value if the attribute is present. More...
 
bool optionalAttributeAsDouble_ (double &value, const xercesc::Attributes &a, const XMLCh *name) const
 Assigns the attribute content to the double value if the attribute is present. More...
 
bool optionalAttributeAsDoubleList_ (DoubleList &value, const xercesc::Attributes &a, const XMLCh *name) const
 Assigns the attribute content to the DoubleList value if the attribute is present. More...
 
bool optionalAttributeAsIntList_ (IntList &value, const xercesc::Attributes &a, const XMLCh *name) const
 Assigns the attribute content to the IntList value if the attribute is present. More...
 
bool optionalAttributeAsStringList_ (StringList &value, const xercesc::Attributes &a, const XMLCh *name) const
 Assigns the attribute content to the StringList value if the attribute is present. More...
 
SignedSize cvStringToEnum_ (const Size section, const String &term, const char *message, const SignedSize result_on_error=0)
 
- Protected Attributes inherited from XMLHandler
String error_message_
 Error message of the last error. More...
 
String file_
 File name. More...
 
String version_
 Schema version. More...
 
StringManager sm_
 Helper class for string conversion. More...
 
std::vector< Stringopen_tags_
 Stack of open XML tags. More...
 
std::vector< std::vector< String > > cv_terms_
 Array of CV term lists (one sublist denotes one term and it's children) More...
 

Detailed Description

XMLHandler for the result files of XQuest.

Constructor & Destructor Documentation

◆ XQuestResultXMLHandler()

XQuestResultXMLHandler ( const String filename,
std::vector< std::vector< PeptideIdentification > > &  csms,
std::vector< ProteinIdentification > &  prot_ids,
Size  min_n_ions_per_spectrum,
bool  load_to_peptideHit_ 
)

◆ ~XQuestResultXMLHandler()

virtual ~XQuestResultXMLHandler ( )
virtual

Member Function Documentation

◆ addMetaValues_()

void addMetaValues_ ( MetaInfoInterface meta_info_interface)
private

Assignes all meta values stored in the peptide_id_attributes member to an meta info interface.

Parameters
meta_info_interfaceWhere the meta values from the peptide_id_attributes member should be assigned to

◆ endElement()

void endElement ( const XMLCh *const  uri,
const XMLCh *const  localname,
const XMLCh *const  qname 
)
virtual

Parsing method for closing tags.

Reimplemented from XMLHandler.

◆ extractDateTime_()

void extractDateTime_ ( const String xquest_datetime_string,
DateTime date_time 
)
inlineprivate

Extracts the DateTime from datetime string from xQuest.

Parameters
xquest_datetime_stringThe DateTime String to be processed
date_timeDateTime that reflects the value given in the `xquest_datetime_string`

◆ getLinkPosition_()

void getLinkPosition_ ( const xercesc::Attributes &  attributes,
std::pair< SignedSize, SignedSize > &  pair 
)
private

Gets the link location of a xQuest xlinkPositionString.

Parameters
attributesXML attributes of Xerces.
pairPair to be populated with the xlinkposition in xQuest.

◆ getMaxScore()

double getMaxScore ( ) const

Returns the maximum score encountered in the file.

Returns
Maximum score encountered in the file.

◆ getMinScore()

double getMinScore ( ) const

Returns the minimum score encountered in the file.

Returns
Minimum score encountered in the file.

◆ getNumberOfHits()

UInt getNumberOfHits ( ) const

Returns the total number of hits in the file.

Returns
Total number of hits in the file.

◆ setMetaValue_() [1/2]

void setMetaValue_ ( const String key,
const DataValue datavalue,
PeptideIdentification pep_id,
PeptideHit alpha 
)
private

Sets the meta value of the peptide identification for alpha hit.

Parameters
keyWhich meta value to set
datavalueValue to be set
pep_idFor which peptide identification the meta value should be set.
alphaAlpha peptide hit for which the meta value should be set.

◆ setMetaValue_() [2/2]

void setMetaValue_ ( const String key,
const DataValue datavalue,
PeptideIdentification pep_id,
PeptideHit alpha,
PeptideHit beta 
)
private

Sets the meta value of the peptide identification for alpha hit.

Parameters
keyWhich meta value to set
datavalueValue to be set
pep_idFor which peptide identification the meta value should be set.
alphaAlpha peptide hit for which the meta value should be set.
betaBeta peptide hit for which the meta value should be set.

◆ setPeptideEvidence_()

void setPeptideEvidence_ ( const String prot_string,
PeptideHit pep_hit 
)
private

Sets the peptide evidence for Alpha and Beta.

Parameters
prot_stringProtein string of the xquest file the peptide evidence should be populated from.
pep_hitFor which peptide hit the peptide evidence should be set.

◆ startElement()

void startElement ( const XMLCh *const  uri,
const XMLCh *const  localname,
const XMLCh *const  qname,
const xercesc::Attributes &  attrs 
)
virtual

Parsing method for opening tags.

Reimplemented from XMLHandler.

Member Data Documentation

◆ accessions_

std::set< String > accessions_
private

◆ charges_

std::set< UInt > charges_
private

◆ csms_

std::vector< std::vector< PeptideIdentification > >& csms_
private

◆ current_spectrum_search_

std::vector< PeptideIdentification > current_spectrum_search_
private

◆ decoy_string

const String decoy_string
static

◆ enzymes

std::map< Size, String > enzymes
static

◆ enzymes_db_

EnzymesDB* enzymes_db_
private

◆ is_openproxl_

bool is_openproxl_
private

◆ load_to_peptideHit_

bool load_to_peptideHit_
private

◆ max_precursor_charge_

UInt max_precursor_charge_
private

◆ max_score_

double max_score_
private

◆ min_n_ions_per_spectrum_

Size min_n_ions_per_spectrum_
private

◆ min_precursor_charge_

UInt min_precursor_charge_
private

◆ min_score_

double min_score_
private

◆ monolinks_masses_

std::set< double > monolinks_masses_
private

◆ months

std::map<String, UInt> months
static

◆ n_hits_

UInt n_hits_
private

◆ peptide_id_meta_values_

std::map<String, DataValue> peptide_id_meta_values_
private

◆ prot_ids_

std::vector< ProteinIdentification >& prot_ids_
private

◆ rt_light_

double rt_light_
private

OpenMS / TOPP release 2.3.0 Documentation generated on Tue Jan 9 2018 18:22:15 using doxygen 1.8.13