OpenMS
MascotXMLHandler.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-2023.
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: Timo Sachsenberg $
32 // $Authors: Nico Pfeifer, Chris Bielow $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
44 
45 #include <vector>
46 
47 namespace OpenMS
48 {
49  namespace Internal
50  {
54  class OPENMS_DLLAPI MascotXMLHandler :
55  public XMLHandler
56  {
57 public:
59  MascotXMLHandler(ProteinIdentification& protein_identification,
60  std::vector<PeptideIdentification>& identifications,
61  const String& filename,
62  std::map<String, std::vector<AASequence> >& peptides,
63  const SpectrumMetaDataLookup& lookup);
64 
66  ~MascotXMLHandler() override;
67 
68  // Docu in base class
69  void endElement(const XMLCh* const /*uri*/, const XMLCh* const /*local_name*/, const XMLCh* const qname) override;
70 
71  // Docu in base class
72  void startElement(const XMLCh* const /*uri*/, const XMLCh* const /*local_name*/, const XMLCh* const qname, const xercesc::Attributes& attributes) override;
73 
74  // Docu in base class
75  void characters(const XMLCh* const chars, const XMLSize_t /*length*/) override;
76 
78  static std::vector<String> splitModificationBySpecifiedAA(const String& mod);
79 
80 private:
81 
83  std::vector<PeptideIdentification>& id_data_;
95  std::map<String, std::vector<AASequence> >& modified_peptides_;
96 
101 
102  // list of modifications, which cannot be set as fixed and needs
103  // to be removed, because added from mascot as variable modification
104  std::vector<String> remove_fixed_mods_;
105 
108 
111  };
112 
113  } // namespace Internal
114 } // namespace OpenMS
115 
DateTime Class.
Definition: DateTime.h:59
Handler that is used for parsing MascotXML data.
Definition: MascotXMLHandler.h:56
String minor_version_
Definition: MascotXMLHandler.h:100
UInt actual_query_
Definition: MascotXMLHandler.h:91
PeptideEvidence actual_peptide_evidence_
Definition: MascotXMLHandler.h:86
String major_version_
Definition: MascotXMLHandler.h:99
static std::vector< String > splitModificationBySpecifiedAA(const String &mod)
Split modification search parameter if for more than one amino acid specified e.g....
std::map< String, std::vector< AASequence > > & modified_peptides_
Definition: MascotXMLHandler.h:95
PeptideHit actual_peptide_hit_
Definition: MascotXMLHandler.h:85
ProteinIdentification::SearchParameters search_parameters_
Definition: MascotXMLHandler.h:92
bool no_rt_error_
Error for missing RT information already reported?
Definition: MascotXMLHandler.h:110
String tag_
Definition: MascotXMLHandler.h:88
String date_time_string_
Definition: MascotXMLHandler.h:90
String actual_title_
Definition: MascotXMLHandler.h:94
StringList tags_open_
tracking the current XML tree
Definition: MascotXMLHandler.h:97
std::vector< PeptideIdentification > & id_data_
the identifications (storing the peptide hits)
Definition: MascotXMLHandler.h:83
ProteinHit actual_protein_hit_
Definition: MascotXMLHandler.h:84
MascotXMLHandler(ProteinIdentification &protein_identification, std::vector< PeptideIdentification > &identifications, const String &filename, std::map< String, std::vector< AASequence > > &peptides, const SpectrumMetaDataLookup &lookup)
Constructor.
void startElement(const XMLCh *const, const XMLCh *const, const XMLCh *const qname, const xercesc::Attributes &attributes) override
DateTime date_
Definition: MascotXMLHandler.h:89
UInt peptide_identification_index_
Definition: MascotXMLHandler.h:87
const SpectrumMetaDataLookup & lookup_
Helper object for looking up RT information.
Definition: MascotXMLHandler.h:107
void characters(const XMLCh *const chars, const XMLSize_t) override
String character_buffer_
filled by MascotXMLHandler::characters
Definition: MascotXMLHandler.h:98
~MascotXMLHandler() override
Destructor.
void endElement(const XMLCh *const, const XMLCh *const, const XMLCh *const qname) override
ProteinIdentification & protein_identification_
the protein identifications
Definition: MascotXMLHandler.h:82
std::vector< String > remove_fixed_mods_
Definition: MascotXMLHandler.h:104
String identifier_
Definition: MascotXMLHandler.h:93
Base class for XML handlers.
Definition: XMLHandler.h:326
Representation of a peptide evidence.
Definition: PeptideEvidence.h:51
Representation of a peptide hit.
Definition: PeptideHit.h:57
Representation of a protein hit.
Definition: ProteinHit.h:60
Representation of a protein identification run.
Definition: ProteinIdentification.h:76
Helper class for looking up spectrum meta data.
Definition: SpectrumMetaDataLookup.h:143
A more convenient string class.
Definition: String.h:60
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:70
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:48
Search parameters of the DB search.
Definition: ProteinIdentification.h:273