ProteoWizard
Serializer_pepXML.hpp
Go to the documentation of this file.
1 //
2 // $Id$
3 //
4 //
5 // Original author: Matt Chambers <matt.chambers .@. vanderbilt.edu>
6 //
7 // Copyright 2010 Vanderbilt University - Nashville, TN 37232
8 //
9 // Licensed under the Apache License, Version 2.0 (the "License");
10 // you may not use this file except in compliance with the License.
11 // You may obtain a copy of the License at
12 //
13 // http://www.apache.org/licenses/LICENSE-2.0
14 //
15 // Unless required by applicable law or agreed to in writing, software
16 // distributed under the License is distributed on an "AS IS" BASIS,
17 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 // See the License for the specific language governing permissions and
19 // limitations under the License.
20 //
21 
22 
23 #ifndef _SERIALIZER_PEPXML_HPP_
24 #define _SERIALIZER_PEPXML_HPP_
25 
27 #include "IdentData.hpp"
29 
30 
31 namespace pwiz {
32 namespace identdata {
33 
34 
35 /// MZIDData <-> pepXML stream serialization
37 {
38  public:
39 
40  /// Serializer_pepXML configuration
42  {
44 
45  Config(bool readSpectrumQueries = true) : readSpectrumQueries(readSpectrumQueries) {}
46  };
47 
48  Serializer_pepXML(const Config& config = Config()) : config_(config) {}
49 
50  /// write MZIDData object to ostream as pepXML
51  void write(std::ostream& os, const IdentData& mzid, const std::string& filepath,
52  const pwiz::util::IterationListenerRegistry* = 0) const;
53 
54  /// read in MZIDData object from a pepXML istream
55  void read(boost::shared_ptr<std::istream> is, IdentData& mzid,
56  const pwiz::util::IterationListenerRegistry* = 0) const;
57 
58  private:
59  const Config config_;
62 };
63 
64 
66 {
67  std::string cut, no_cut, sense;
68 };
69 
70 /// converts an identdata::Enzyme into a pepXML cut/no_cut/sense tuple
72 
73 
74 /// strips charge state from known conventions of the pepXML spectrum attribute;
75 /// used to find a unique identifier for a spectrum in order to merge charge states
76 PWIZ_API_DECL std::string stripChargeFromConventionalSpectrumId(const std::string& id);
77 
78 
79 /// converts a software name stored in pepXML software element into its corresponding CVID, or CVID_Unknown if no mapping was found
80 PWIZ_API_DECL CVID pepXMLSoftwareNameToCVID(const std::string& softwareName);
81 
82 /// converts a software CVID to the preferred name for that software in pepXML; an unrecognized software name will return an empty string
83 PWIZ_API_DECL const std::string& softwareCVIDToPepXMLSoftwareName(CVID softwareCVID);
84 
85 
86 /// for a given software CVID, converts a pepXML score name into its corresponding CVID, or CVID_Unknown if no mapping was found
87 PWIZ_API_DECL CVID pepXMLScoreNameToCVID(CVID softwareCVID, const std::string& scoreName);
88 
89 /// for a given software CVID, converts a score CVID into the preferred name for that score in pepXML; an invalid combination of software/score will return an empty string
90 PWIZ_API_DECL const std::string& scoreCVIDToPepXMLScoreName(CVID softwareCVID, CVID scoreCVID);
91 
92 
93 /// attempts to convert a period-delimited id into a nativeID format (e.g. "1.0.123" appears to be a Thermo nativeID)
94 PWIZ_API_DECL CVID nativeIdStringToCVID(const std::string& id);
95 
96 
97 } // namespace identdata
98 } // namespace pwiz
99 
100 #endif // _SERIALIZER_PEPXML_HPP_
Implementation of EnzymeType from the mzIdentML schema.
Definition: IdentData.hpp:408
PWIZ_API_DECL CVID pepXMLScoreNameToCVID(CVID softwareCVID, const std::string &scoreName)
for a given software CVID, converts a pepXML score name into its corresponding CVID, or CVID_Unknown if no mapping was found
PWIZ_API_DECL const std::string & softwareCVIDToPepXMLSoftwareName(CVID softwareCVID)
converts a software CVID to the preferred name for that software in pepXML; an unrecognized software ...
PWIZ_API_DECL CVID pepXMLSoftwareNameToCVID(const std::string &softwareName)
converts a software name stored in pepXML software element into its corresponding CVID...
PWIZ_API_DECL PepXMLSpecificity pepXMLSpecificity(const Enzyme &ez)
converts an identdata::Enzyme into a pepXML cut/no_cut/sense tuple
MZIDData <-> pepXML stream serialization.
Serializer_pepXML configuration.
PWIZ_API_DECL void write(minimxml::XMLWriter &writer, const CV &cv)
Implementation of the MzIdentMLType from the mzIdentML schema.
Definition: IdentData.hpp:993
#define PWIZ_API_DECL
Definition: Export.hpp:32
PWIZ_API_DECL void read(std::istream &is, CV &cv)
handles registration of IterationListeners and broadcast of update messages
Serializer_pepXML(const Config &config=Config())
PWIZ_API_DECL CVID nativeIdStringToCVID(const std::string &id)
attempts to convert a period-delimited id into a nativeID format (e.g. "1.0.123" appears to be a Ther...
PWIZ_API_DECL const std::string & scoreCVIDToPepXMLScoreName(CVID softwareCVID, CVID scoreCVID)
for a given software CVID, converts a score CVID into the preferred name for that score in pepXML; an...
PWIZ_API_DECL std::string stripChargeFromConventionalSpectrumId(const std::string &id)
strips charge state from known conventions of the pepXML spectrum attribute; used to find a unique id...