Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
XQuestResultXMLHandler.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2017.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Lukas Zimmermann $
32 // $Authors: Lukas Zimmermann $
33 // --------------------------------------------------------------------------
34 #ifndef OPENMS_FORMAT_HANDLERS_XQUESTRESULTXMLHANDLER_H
35 #define OPENMS_FORMAT_HANDLERS_XQUESTRESULTXMLHANDLER_H
36 
43 
44 namespace OpenMS
45 {
46  namespace Internal
47  {
50  class OPENMS_DLLAPI XQuestResultXMLHandler :
51  public XMLHandler
52  {
53  public:
54 
55  // Maps enzyme_num in xQuest result file to the enzyme name used by OpenMS
56  static std::map< Size, String > enzymes;
57 
58  // Maps String encoding month to the numeric value
59  static std::map<String, UInt> months;
60 
61  // Decoy string used by xQuest
62  static const String decoy_string;
63 
64  XQuestResultXMLHandler(const String & filename,
65  std::vector< std::vector< PeptideIdentification > > & csms,
66  std::vector< ProteinIdentification > & prot_ids,
67  Size min_n_ions_per_spectrum,
68  bool load_to_peptideHit_);
69  virtual ~XQuestResultXMLHandler();
70 
71  // Docu in base class
72  void endElement(const XMLCh * const uri, const XMLCh * const local_name, const XMLCh * const qname);
73 
74  // Docu in base class
75  void startElement(const XMLCh * const uri, const XMLCh * const local_name, const XMLCh * const qname, const xercesc::Attributes & attributes);
76 
81  double getMinScore() const;
82 
87  double getMaxScore() const;
88 
93  UInt getNumberOfHits() const;
94 
95  private:
96 
97  // Main data structures that are populated during loading the file
98  std::vector< std::vector< PeptideIdentification > > & csms_;
99  std::vector< ProteinIdentification > & prot_ids_;
100 
101  UInt n_hits_; // Total no. of hits found in the result XML file
102 
103  // Keeps track of the minscore and maxscore encountered
104  double min_score_;
105  double max_score_;
106 
108  bool load_to_peptideHit_; // Whether Meta data of peptide identification should also be loaded to peptide hit
109 
110  // Whether or not current xquest result tag comes from OpenProXL (xQuest otherwise)
112 
113  // Set of all protein accessions that are within the ProteinHits.
114  std::set< String > accessions_;
115 
116  // The enzyme database for enzyme lookup
118 
119  // Keeps track of the charges of the hits
120  std::set< UInt > charges_;
123 
124  // Current Retention time of light spectrum
125  double rt_light_;
126 
127  // The masses of the Monolinks
128  std::set< double > monolinks_masses_;
129 
130  // The current spectrum search
131  std::vector< PeptideIdentification > current_spectrum_search_;
132 
133  // Stores the attributes of a record (peptide identification)
134  std::map<String, DataValue> peptide_id_meta_values_;
135 
141  inline void extractDateTime_(const String & xquest_datetime_string, DateTime & date_time);
142 
147  void addMetaValues_(MetaInfoInterface & meta_info_interface);
148 
154  void getLinkPosition_(const xercesc::Attributes & attributes, std::pair<SignedSize, SignedSize> & pair);
155 
161  void setPeptideEvidence_(const String & prot_string, PeptideHit & pep_hit);
162 
170  void setMetaValue_(const String & key, const DataValue & datavalue, PeptideIdentification & pep_id, PeptideHit & alpha);
171 
180  void setMetaValue_(const String & key, const DataValue & datavalue, PeptideIdentification & pep_id, PeptideHit & alpha, PeptideHit & beta);
181  };
182  } // namespace Internal
183 } // namespace OpenMS
184 #endif // OPENMS_FORMAT_HANDLERS_XQUESTRESULTXMLHANDLER_H
UInt n_hits_
Definition: XQuestResultXMLHandler.h:101
A more convenient string class.
Definition: String.h:57
Size min_n_ions_per_spectrum_
Definition: XQuestResultXMLHandler.h:107
double rt_light_
Definition: XQuestResultXMLHandler.h:125
unsigned int UInt
Unsigned integer type.
Definition: Types.h:95
XMLHandler for the result files of XQuest.
Definition: XQuestResultXMLHandler.h:50
double min_score_
Definition: XQuestResultXMLHandler.h:104
Base class for XML handlers.
Definition: XMLHandler.h:110
std::vector< PeptideIdentification > current_spectrum_search_
Definition: XQuestResultXMLHandler.h:131
bool load_to_peptideHit_
Definition: XQuestResultXMLHandler.h:108
std::set< double > monolinks_masses_
Definition: XQuestResultXMLHandler.h:128
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
Class to hold strings, numeric values, lists of strings and lists of numeric values.
Definition: DataValue.h:57
EnzymesDB * enzymes_db_
Definition: XQuestResultXMLHandler.h:117
UInt max_precursor_charge_
Definition: XQuestResultXMLHandler.h:122
Representation of a peptide hit.
Definition: PeptideHit.h:55
std::vector< ProteinIdentification > & prot_ids_
Definition: XQuestResultXMLHandler.h:99
UInt min_precursor_charge_
Definition: XQuestResultXMLHandler.h:121
Interface for classes that can store arbitrary meta information (Type-Name-Value tuples).
Definition: MetaInfoInterface.h:56
double max_score_
Definition: XQuestResultXMLHandler.h:105
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:128
bool is_openproxl_
Definition: XQuestResultXMLHandler.h:111
DateTime Class.
Definition: DateTime.h:55
std::vector< std::vector< PeptideIdentification > > & csms_
Definition: XQuestResultXMLHandler.h:98
static std::map< String, UInt > months
Definition: XQuestResultXMLHandler.h:59
std::set< String > accessions_
Definition: XQuestResultXMLHandler.h:114
static const String decoy_string
Definition: XQuestResultXMLHandler.h:62
enzyme database which holds enzymes
Definition: EnzymesDB.h:56
std::map< String, DataValue > peptide_id_meta_values_
Definition: XQuestResultXMLHandler.h:134
static std::map< Size, String > enzymes
Definition: XQuestResultXMLHandler.h:56
std::set< UInt > charges_
Definition: XQuestResultXMLHandler.h:120
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:63

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