Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef OPENMS_FORMAT_HANDLERS_MZIDENTMLHANDLER_H
00036 #define OPENMS_FORMAT_HANDLERS_MZIDENTMLHANDLER_H
00037
00038 #include <OpenMS/KERNEL/StandardTypes.h>
00039
00040 #include <OpenMS/FORMAT/HANDLERS/XMLHandler.h>
00041 #include <OpenMS/FORMAT/ControlledVocabulary.h>
00042 #include <OpenMS/METADATA/IdentificationHit.h>
00043 #include <OpenMS/METADATA/Identification.h>
00044 #include <OpenMS/METADATA/ProteinHit.h>
00045 #include <OpenMS/CHEMISTRY/AASequence.h>
00046 #include <OpenMS/CONCEPT/UniqueIdGenerator.h>
00047 #include <OpenMS/METADATA/ProteinIdentification.h>
00048 #include <OpenMS/METADATA/PeptideIdentification.h>
00049
00050 #include <vector>
00051
00052 namespace OpenMS
00053 {
00054 class ProgressLogger;
00055
00056 namespace Internal
00057 {
00058
00064 class OPENMS_DLLAPI MzIdentMLHandler :
00065 public XMLHandler
00066 {
00067 public:
00070
00071 MzIdentMLHandler(const Identification & id, const String & filename, const String & version, const ProgressLogger & logger);
00073 MzIdentMLHandler(const std::vector<ProteinIdentification> & pro_id, const std::vector<PeptideIdentification> & pep_id, const String & filename, const String & version, const ProgressLogger & logger);
00074
00076 MzIdentMLHandler(Identification & id, const String & filename, const String & version, const ProgressLogger & logger);
00078 MzIdentMLHandler(std::vector<ProteinIdentification> & pro_id, std::vector<PeptideIdentification> & pep_id, const String & filename, const String & version, const ProgressLogger & logger);
00079
00081 virtual ~MzIdentMLHandler();
00083
00084
00085
00086 virtual void endElement(const XMLCh * const , const XMLCh * const , const XMLCh * const qname);
00087
00088
00089 virtual void startElement(const XMLCh * const , const XMLCh * const , const XMLCh * const qname, const xercesc::Attributes & attributes);
00090
00091
00092 virtual void characters(const XMLCh * const chars, const XMLSize_t length);
00093
00094
00095 virtual void writeTo(std::ostream & os);
00096
00097 protected:
00098
00100 const ProgressLogger & logger_;
00101
00103 ControlledVocabulary cv_;
00105 ControlledVocabulary unimod_;
00106
00107
00108
00110 String tag_;
00111
00113 Identification * id_;
00115 std::vector<ProteinIdentification> * pro_id_;
00117 std::vector<PeptideIdentification> * pep_id_;
00118
00119 const Identification * cid_;
00120 const std::vector<ProteinIdentification> * cpro_id_;
00121 const std::vector<PeptideIdentification> * cpep_id_;
00122
00124 SpectrumIdentification current_spectrum_id_;
00125
00127 IdentificationHit current_id_hit_;
00128
00130 void handleCVParam_(const String & parent_parent_tag, const String & parent_tag, const String & accession, const xercesc::Attributes & attributes, const String & cv_ref );
00131
00133 void handleUserParam_(const String & parent_parent_tag, const String & parent_tag, const String & name, const String & type, const String & value);
00134
00136 void writeUserParam_(std::ostream & os, const MetaInfoInterface & meta, UInt indent) const;
00137
00139 ControlledVocabulary::CVTerm getChildWithName_(const String & parent_accession, const String & name) const;
00140
00142
00143
00144
00145 private:
00146 MzIdentMLHandler();
00147 MzIdentMLHandler(const MzIdentMLHandler & rhs);
00148 MzIdentMLHandler & operator=(const MzIdentMLHandler & rhs);
00149 Map<String, AASequence> pep_sequences_;
00150 AASequence actual_peptide_;
00151 Int current_mod_location_;
00152 ProteinHit actual_protein_;
00153
00154 };
00155 }
00156 }
00157
00158 #endif