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_IDXMLFILE_H
00036 #define OPENMS_FORMAT_IDXMLFILE_H
00037
00038 #include <OpenMS/METADATA/ProteinIdentification.h>
00039 #include <OpenMS/METADATA/PeptideIdentification.h>
00040 #include <OpenMS/FORMAT/HANDLERS/XMLHandler.h>
00041 #include <OpenMS/FORMAT/XMLFile.h>
00042
00043 #include <vector>
00044
00045 namespace OpenMS
00046 {
00063 class OPENMS_DLLAPI IdXMLFile :
00064 protected Internal::XMLHandler,
00065 public Internal::XMLFile
00066 {
00067 public:
00068
00070 IdXMLFile();
00071
00081 void load(const String & filename, std::vector<ProteinIdentification> & protein_ids, std::vector<PeptideIdentification> & peptide_ids);
00082
00092 void load(const String & filename, std::vector<ProteinIdentification> & protein_ids, std::vector<PeptideIdentification> & peptide_ids, String & document_id);
00093
00101 void store(String filename, const std::vector<ProteinIdentification> & protein_ids, const std::vector<PeptideIdentification> & peptide_ids, const String & document_id = "");
00102
00103 protected:
00104
00105 virtual void endElement(const XMLCh * const , const XMLCh * const , const XMLCh * const qname);
00106
00107
00108 virtual void startElement(const XMLCh * const , const XMLCh * const , const XMLCh * const qname, const xercesc::Attributes & attributes);
00109
00111 void addProteinGroups_(MetaInfoInterface & meta, const std::vector<ProteinIdentification::ProteinGroup> & groups, const String & group_name, const std::map<String, UInt> & accession_to_id);
00112
00114 void getProteinGroups_(std::vector<ProteinIdentification::ProteinGroup> & groups, const String & group_name);
00115
00117
00118
00119 std::vector<ProteinIdentification> * prot_ids_;
00121 std::vector<PeptideIdentification> * pep_ids_;
00123 MetaInfoInterface * last_meta_;
00125 std::map<String, ProteinIdentification::SearchParameters> parameters_;
00127 ProteinIdentification::SearchParameters param_;
00129 String id_;
00131 ProteinIdentification prot_id_;
00133 PeptideIdentification pep_id_;
00135 ProteinHit prot_hit_;
00137 PeptideHit pep_hit_;
00139 std::map<String, String> proteinid_to_accession_;
00141 String * document_id_;
00143 bool prot_id_in_run_;
00145 };
00146
00147 }
00148
00149 #endif // OPENMS_FORMAT_IDXMLFILE_H