OpenMS
ProtXMLFile.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Chris Bielow $
6 // $Authors: $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
14 #include <OpenMS/FORMAT/XMLFile.h>
15 
16 #include <vector>
17 
18 namespace OpenMS
19 {
41  class OPENMS_DLLAPI ProtXMLFile :
42  protected Internal::XMLHandler,
43  public Internal::XMLFile
44  {
45 public:
46 
49 
52 
62  void load(const String & filename, ProteinIdentification & protein_ids, PeptideIdentification & peptide_ids);
63 
72  void store(const String & filename, const ProteinIdentification & protein_ids, const PeptideIdentification & peptide_ids, const String & document_id = "");
73 
74 protected:
75 
77  void resetMembers_();
78 
80  void endElement(const XMLCh * const /*uri*/, const XMLCh * const /*local_name*/, const XMLCh * const qname) override;
81 
83  void startElement(const XMLCh * const /*uri*/, const XMLCh * const /*local_name*/, const XMLCh * const qname, const xercesc::Attributes & attributes) override;
84 
86  void registerProtein_(const String & protein_name);
87 
100  void matchModification_(const double mass, const String & origin, String & modification_description);
101 
103 
104  ProteinIdentification * prot_id_;
112 
113 
115  };
116 
117 } // namespace OpenMS
118 
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
Representation of a peptide hit.
Definition: PeptideHit.h:31
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:39
Used to load (storing not supported, yet) ProtXML files.
Definition: ProtXMLFile.h:44
void store(const String &filename, const ProteinIdentification &protein_ids, const PeptideIdentification &peptide_ids, const String &document_id="")
[not implemented yet!] Stores the data in an ProtXML file
ProteinIdentification::ProteinGroup ProteinGroup
A protein group (set of indices into ProteinIdentification)
Definition: ProtXMLFile.h:48
ProtXMLFile()
Constructor.
PeptideHit * pep_hit_
Temporary peptide hit.
Definition: ProtXMLFile.h:109
void registerProtein_(const String &protein_name)
Creates a new protein entry (if not already present) and appends it to the current group.
void matchModification_(const double mass, const String &origin, String &modification_description)
find modification name given a modified AA mass
void load(const String &filename, ProteinIdentification &protein_ids, PeptideIdentification &peptide_ids)
Loads the identifications of an ProtXML file without identifier.
PeptideIdentification * pep_id_
Pointer to peptide identification.
Definition: ProtXMLFile.h:107
ProteinGroup protein_group_
protein group
Definition: ProtXMLFile.h:111
void startElement(const XMLCh *const, const XMLCh *const, const XMLCh *const qname, const xercesc::Attributes &attributes) override
Docu in base class.
void endElement(const XMLCh *const, const XMLCh *const, const XMLCh *const qname) override
Docu in base class.
void resetMembers_()
reset members after reading/writing
Bundles multiple (e.g. indistinguishable) proteins in a group.
Definition: ProteinIdentification.h:105
Representation of a protein identification run.
Definition: ProteinIdentification.h:50
A more convenient string class.
Definition: String.h:34
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19