OpenMS
OMSSAXMLFile.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Timo Sachsenberg $
6 // $Authors: Andreas Bertsch $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
12 #include <OpenMS/FORMAT/XMLFile.h>
17 
18 #include <vector>
19 
20 namespace OpenMS
21 {
22  class String;
23  class ModificationsDB;
24 
33  class OPENMS_DLLAPI OMSSAXMLFile :
34  protected Internal::XMLHandler,
35  public Internal::XMLFile
36  {
37 public:
38 
41 
43  ~OMSSAXMLFile() override;
61  void load(const String& filename,
62  ProteinIdentification& protein_identification,
63  std::vector<PeptideIdentification>& id_data,
64  bool load_proteins = true,
65  bool load_empty_hits = true);
66 
69 
70 protected:
71  // Docu in base class
72  void endElement(const XMLCh* const /*uri*/, const XMLCh* const /*local_name*/, const XMLCh* const qname) override;
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) override;
76 
77  // Docu in base class
78  void characters(const XMLCh* const chars, const XMLSize_t /*length*/) override;
79 
80 private:
81 
83 
85 
88 
90  std::vector<PeptideIdentification>* peptide_identifications_;
91 
93 
95 
97 
98  std::vector<PeptideEvidence> actual_peptide_evidences_;
99 
101 
103 
105 
108 
111 
113  std::vector<std::pair<UInt, String> > modifications_;
114 
117 
120 
122  std::map<UInt, std::vector<const ResidueModification*> > mods_map_;
123 
125  std::map<String, UInt> mods_to_num_;
126 
129  };
130 
131 } // namespace OpenMS
132 
Base class for loading/storing XML files that have a handler derived from XMLHandler.
Definition: XMLFile.h:23
Base class for XML handlers.
Definition: XMLHandler.h:302
Definition: ModificationDefinitionsSet.h:33
Used to load OMSSAXML files.
Definition: OMSSAXMLFile.h:36
OMSSAXMLFile & operator=(const OMSSAXMLFile &rhs)
std::vector< PeptideEvidence > actual_peptide_evidences_
Definition: OMSSAXMLFile.h:98
PeptideEvidence actual_peptide_evidence_
Definition: OMSSAXMLFile.h:96
void readMappingFile_()
reads the mapping file needed for modifications
ProteinIdentification actual_protein_id_
Definition: OMSSAXMLFile.h:102
PeptideIdentification actual_peptide_id_
Definition: OMSSAXMLFile.h:100
std::map< UInt, std::vector< const ResidueModification * > > mods_map_
modifications mapping file from OMSSA mod num to UniMod accession
Definition: OMSSAXMLFile.h:122
PeptideHit actual_peptide_hit_
Definition: OMSSAXMLFile.h:94
std::vector< PeptideIdentification > * peptide_identifications_
the identifications (storing the peptide hits)
Definition: OMSSAXMLFile.h:90
String tag_
Definition: OMSSAXMLFile.h:104
ModificationDefinitionsSet mod_def_set_
modification definitions set of the search, needed to annotate fixed modifications
Definition: OMSSAXMLFile.h:128
std::map< String, UInt > mods_to_num_
modification mapping reverse, from the modification to the mod_num
Definition: OMSSAXMLFile.h:125
OMSSAXMLFile()
Default constructor.
OMSSAXMLFile(const OMSSAXMLFile &rhs)
ProteinHit actual_protein_hit_
Definition: OMSSAXMLFile.h:92
bool load_empty_hits_
should empty peptide identifications be loaded or skipped?
Definition: OMSSAXMLFile.h:119
void startElement(const XMLCh *const, const XMLCh *const, const XMLCh *const qname, const xercesc::Attributes &attributes) override
String actual_mod_type_
type of the modification
Definition: OMSSAXMLFile.h:110
void setModificationDefinitionsSet(const ModificationDefinitionsSet &rhs)
sets the valid modifications
bool load_proteins_
should protein hits be read from the file?
Definition: OMSSAXMLFile.h:116
void characters(const XMLCh *const chars, const XMLSize_t) override
std::vector< std::pair< UInt, String > > modifications_
modifications of the peptide defined by site and type
Definition: OMSSAXMLFile.h:113
~OMSSAXMLFile() override
Destructor.
void endElement(const XMLCh *const, const XMLCh *const, const XMLCh *const qname) override
UInt actual_mod_site_
site of the actual modification (simple position in the peptide)
Definition: OMSSAXMLFile.h:107
Representation of a peptide evidence.
Definition: PeptideEvidence.h:25
Representation of a peptide hit.
Definition: PeptideHit.h:31
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:39
Representation of a protein hit.
Definition: ProteinHit.h:34
Representation of a protein identification run.
Definition: ProteinIdentification.h:50
A more convenient string class.
Definition: String.h:34
unsigned int UInt
Unsigned integer type.
Definition: Types.h:64
void load(const String &filename, ProteinIdentification &protein_identification, std::vector< PeptideIdentification > &id_data, bool load_proteins=true, bool load_empty_hits=true)
loads data from a OMSSAXML file
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19