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_
IterationListener.hpp
pwiz
Definition: ChromatogramList_Filter.hpp:36
pwiz::identdata::Serializer_pepXML::write
void write(std::ostream &os, const IdentData &mzid, const std::string &filepath, const pwiz::util::IterationListenerRegistry *=0) const
write MZIDData object to ostream as pepXML
pwiz::identdata::pepXMLSpecificity
PWIZ_API_DECL PepXMLSpecificity pepXMLSpecificity(const Enzyme &ez)
converts an identdata::Enzyme into a pepXML cut/no_cut/sense tuple
pwiz::identdata::pepXMLSoftwareNameToCVID
PWIZ_API_DECL CVID pepXMLSoftwareNameToCVID(const std::string &softwareName)
converts a software name stored in pepXML software element into its corresponding CVID,...
pwiz::identdata::PepXMLSpecificity::sense
std::string sense
Definition: Serializer_pepXML.hpp:67
pwiz::identdata::Serializer_pepXML
MZIDData <-> pepXML stream serialization.
Definition: Serializer_pepXML.hpp:37
pwiz::identdata::Serializer_pepXML::operator=
Serializer_pepXML & operator=(Serializer_pepXML &)
PWIZ_API_DECL
#define PWIZ_API_DECL
Definition: Export.hpp:32
pwiz::identdata::Enzyme
Implementation of EnzymeType from the mzIdentML schema.
Definition: IdentData.hpp:409
pwiz::identdata::Serializer_pepXML::Serializer_pepXML
Serializer_pepXML(const Config &config=Config())
Definition: Serializer_pepXML.hpp:48
pwiz::identdata::softwareCVIDToPepXMLSoftwareName
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 ...
Export.hpp
pwiz::identdata::Serializer_pepXML::Config
Serializer_pepXML configuration.
Definition: Serializer_pepXML.hpp:42
pwiz::identdata::scoreCVIDToPepXMLScoreName
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...
IdentData.hpp
pwiz::identdata::Serializer_pepXML::Serializer_pepXML
Serializer_pepXML(Serializer_pepXML &)
pwiz::identdata::PepXMLSpecificity
Definition: Serializer_pepXML.hpp:66
pwiz::util::IterationListenerRegistry
handles registration of IterationListeners and broadcast of update messages
Definition: IterationListener.hpp:66
pwiz::identdata::IdentData
Implementation of the MzIdentMLType from the mzIdentML schema.
Definition: IdentData.hpp:994
pwiz::identdata::stripChargeFromConventionalSpectrumId
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...
pwiz::identdata::nativeIdStringToCVID
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::identdata::Serializer_pepXML::Config::readSpectrumQueries
bool readSpectrumQueries
Definition: Serializer_pepXML.hpp:43
pwiz::identdata::Serializer_pepXML::config_
const Config config_
Definition: Serializer_pepXML.hpp:59
pwiz::identdata::Serializer_pepXML::Config::Config
Config(bool readSpectrumQueries=true)
Definition: Serializer_pepXML.hpp:45
pwiz::identdata::Serializer_pepXML::read
void read(boost::shared_ptr< std::istream > is, IdentData &mzid, const pwiz::util::IterationListenerRegistry *=0) const
read in MZIDData object from a pepXML istream
pwiz::identdata::pepXMLScoreNameToCVID
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,...