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 {
44  class OPENMS_DLLAPI ProtXMLFile :
45  protected Internal::XMLHandler,
46  public Internal::XMLFile
47  {
48 public:
49 
52 
55 
65  void load(const String & filename, ProteinIdentification & protein_ids, PeptideIdentification & peptide_ids);
66 
75  void store(const String & filename, const ProteinIdentification & protein_ids, const PeptideIdentification & peptide_ids, const String & document_id = "");
76 
77 protected:
78 
80  void resetMembers_();
81 
83  void endElement(const XMLCh * const /*uri*/, const XMLCh * const /*local_name*/, const XMLCh * const qname) override;
84 
86  void startElement(const XMLCh * const /*uri*/, const XMLCh * const /*local_name*/, const XMLCh * const qname, const xercesc::Attributes & attributes) override;
87 
89  void registerProtein_(const String & protein_name);
90 
103  void matchModification_(const double mass, const String & origin, String & modification_description);
104 
106 
107  ProteinIdentification * prot_id_;
115 
116 
118  };
119 
120 } // namespace OpenMS
121 
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:47
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:51
ProtXMLFile()
Constructor.
PeptideHit * pep_hit_
Temporary peptide hit.
Definition: ProtXMLFile.h:112
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:110
ProteinGroup protein_group_
protein group
Definition: ProtXMLFile.h:114
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