| OpenMS 2.5.0

OMSSAXMLFile.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-2020.
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: Andreas Bertsch $
33 // --------------------------------------------------------------------------
34
35 #pragma once
36
37 #include <OpenMS/FORMAT/HANDLERS/XMLHandler.h>
38 #include <OpenMS/FORMAT/XMLFile.h>
39 #include <OpenMS/METADATA/ProteinIdentification.h>
40 #include <OpenMS/METADATA/PeptideIdentification.h>
41 #include <OpenMS/DATASTRUCTURES/Map.h>
42 #include <OpenMS/CHEMISTRY/ResidueModification.h>
43 #include <OpenMS/CHEMISTRY/ModificationDefinitionsSet.h>
44
45 #include <vector>
46
47 namespace OpenMS
48 {
49 class String;
50 class ModificationsDB;
51
60 class OPENMS_DLLAPI OMSSAXMLFile :
61 protected Internal::XMLHandler,
62 public Internal::XMLFile
63 {
64 public:
65
67 OMSSAXMLFile();
68
70 ~OMSSAXMLFile() override;
88 void load(const String& filename,
89 ProteinIdentification& protein_identification,
90 std::vector<PeptideIdentification>& id_data,
91 bool load_proteins = true,
92 bool load_empty_hits = true);
93
95 void setModificationDefinitionsSet(const ModificationDefinitionsSet& rhs);
96
97 protected:
98 // Docu in base class
99 void endElement(const XMLCh* const /*uri*/, const XMLCh* const /*local_name*/, const XMLCh* const qname) override;
100
101 // Docu in base class
102 void startElement(const XMLCh* const /*uri*/, const XMLCh* const /*local_name*/, const XMLCh* const qname, const xercesc::Attributes& attributes) override;
103
104 // Docu in base class
105 void characters(const XMLCh* const chars, const XMLSize_t /*length*/) override;
106
107 private:
108
109 OMSSAXMLFile(const OMSSAXMLFile& rhs);
110
111 OMSSAXMLFile& operator=(const OMSSAXMLFile& rhs);
112
114 void readMappingFile_();
115
117 std::vector<PeptideIdentification>* peptide_identifications_;
118
119 ProteinHit actual_protein_hit_;
120
121 PeptideHit actual_peptide_hit_;
122
123 PeptideEvidence actual_peptide_evidence_;
124
125 std::vector<PeptideEvidence> actual_peptide_evidences_;
126
127 PeptideIdentification actual_peptide_id_;
128
129 ProteinIdentification actual_protein_id_;
130
131 String tag_;
132
134 UInt actual_mod_site_;
135
137 String actual_mod_type_;
138
140 std::vector<std::pair<UInt, String> > modifications_;
141
143 bool load_proteins_;
144
146 bool load_empty_hits_;
147
149 Map<UInt, std::vector<const ResidueModification*> > mods_map_;
150
152 Map<String, UInt> mods_to_num_;
153
155 ModificationDefinitionsSet mod_def_set_;
156 };
157
158 } // namespace OpenMS
159
OpenMS::OMSSAXMLFile::actual_protein_id_
ProteinIdentification actual_protein_id_
Definition: OMSSAXMLFile.h:129
ProteinIdentification.h
OpenMS::String
A more convenient string class.
Definition: String.h:58
OpenMS::OMSSAXMLFile::mods_map_
Map< UInt, std::vector< const ResidueModification * > > mods_map_
modifications mapping file from OMSSA mod num to UniMod accession
Definition: OMSSAXMLFile.h:149
XMLFile.h
OpenMS::OMSSAXMLFile::actual_mod_site_
UInt actual_mod_site_
site of the actual modification (simple position in the peptide)
Definition: OMSSAXMLFile.h:134
OpenMS::OMSSAXMLFile::mod_def_set_
ModificationDefinitionsSet mod_def_set_
modification definitions set of the search, needed to annotate fixed modifications ...
Definition: OMSSAXMLFile.h:155
OpenMS::OMSSAXMLFile::actual_peptide_evidence_
PeptideEvidence actual_peptide_evidence_
Definition: OMSSAXMLFile.h:123
XMLHandler.h
OpenMS::OMSSAXMLFile::actual_peptide_id_
PeptideIdentification actual_peptide_id_
Definition: OMSSAXMLFile.h:127
OpenMS::OMSSAXMLFile::modifications_
std::vector< std::pair< UInt, String > > modifications_
modifications of the peptide defined by site and type
Definition: OMSSAXMLFile.h:140
OpenMS::OMSSAXMLFile::tag_
String tag_
Definition: OMSSAXMLFile.h:131
OpenMS::ProteinHit
Representation of a protein hit.
Definition: ProteinHit.h:57
OpenMS::PeptideEvidence
Representation of a peptide evidence.
Definition: PeptideEvidence.h:50
OpenMS::OMSSAXMLFile::load_proteins_
bool load_proteins_
should protein hits be read from the file?
Definition: OMSSAXMLFile.h:143
OpenMS::ProteinIdentification
Representation of a protein identification run.
Definition: ProteinIdentification.h:71
OpenMS::OMSSAXMLFile::peptide_identifications_
std::vector< PeptideIdentification > * peptide_identifications_
the identifications (storing the peptide hits)
Definition: OMSSAXMLFile.h:117
OpenMS::OMSSAXMLFile::load_empty_hits_
bool load_empty_hits_
should empty peptide identifications be loaded or skipped?
Definition: OMSSAXMLFile.h:146
OpenMS::Internal::XMLFile
Base class for loading/storing XML files that have a handler derived from XMLHandler.
Definition: XMLFile.h:48
OpenMS::OMSSAXMLFile::mods_to_num_
Map< String, UInt > mods_to_num_
modification mapping reverse, from the modification to the mod_num
Definition: OMSSAXMLFile.h:152
OpenMS::Map
Map class based on the STL map (containing several convenience functions)
Definition: Map.h:50
ModificationDefinitionsSet.h
PeptideIdentification.h
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
OpenMS::PeptideHit
Representation of a peptide hit.
Definition: PeptideHit.h:54
OpenMS::OMSSAXMLFile::actual_mod_type_
String actual_mod_type_
type of the modification
Definition: OMSSAXMLFile.h:137
Map.h
OpenMS::OMSSAXMLFile::actual_peptide_hit_
PeptideHit actual_peptide_hit_
Definition: OMSSAXMLFile.h:121
OpenMS::UInt
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
OpenMS::OMSSAXMLFile::actual_protein_hit_
ProteinHit actual_protein_hit_
Definition: OMSSAXMLFile.h:119
OpenMS::PeptideIdentification
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:62
OpenMS::ModificationDefinitionsSet
Representation of a set of modification definitions.
Definition: ModificationDefinitionsSet.h:58
OpenMS::Internal::XMLHandler
Base class for XML handlers.
Definition: XMLHandler.h:151
OpenMS::OMSSAXMLFile
Used to load OMSSAXML files.
Definition: OMSSAXMLFile.h:60
ResidueModification.h
OpenMS::OMSSAXMLFile::actual_peptide_evidences_
std::vector< PeptideEvidence > actual_peptide_evidences_
Definition: OMSSAXMLFile.h:125