ProteoWizard
Serializer_pepXML.hpp
Go to the documentation of this file.
1 //
2 // $Id: Serializer_pepXML.hpp 3148 2011-11-23 17:23:35Z chambm $
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 } // namespace identdata
80 } // namespace pwiz
81 
82 #endif // _SERIALIZER_PEPXML_HPP_