ProteoWizard
IdentDataFile.hpp
Go to the documentation of this file.
1 //
2 // $Id$
3 //
4 //
5 // Original author: Robert Burke <robert.burke@proteowizard.org>
6 //
7 // Copyright 2009 Spielberg Family Center for Applied Proteomics
8 // University of Southern California, Los Angeles, California 90033
9 //
10 // Licensed under the Apache License, Version 2.0 (the "License");
11 // you may not use this file except in compliance with the License.
12 // You may obtain a copy of the License at
13 //
14 // http://www.apache.org/licenses/LICENSE-2.0
15 //
16 // Unless required by applicable law or agreed to in writing, software
17 // distributed under the License is distributed on an "AS IS" BASIS,
18 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 // See the License for the specific language governing permissions and
20 // limitations under the License.
21 //
22 
23 
24 #ifndef _IDENTDATAFILE_HPP_
25 #define _IDENTDATAFILE_HPP_
26 
27 
29 #include "IdentData.hpp"
30 #include "Reader.hpp"
32 
33 
34 namespace pwiz {
35 namespace identdata {
36 
37 
38 /// IdentData object plus file I/O
40 {
41  /// constructs IdentData object backed by file;
42  /// reader==0 -> use DefaultReaderList
43  IdentDataFile(const std::string& filename,
44  const Reader* reader = 0,
45  const pwiz::util::IterationListenerRegistry* iterationListenerRegistry = 0,
46  bool ignoreSequenceCollectionAndAnalysisData = false);
47 
48  /// data format for write()
49  enum PWIZ_API_DECL Format {Format_Text, Format_MzIdentML, Format_pepXML};
50 
51  /// configuration for write()
53  {
54  Format format;
55 
57  : format(format)
58  {}
59  };
60 
61  /// static write function for any IdentData object;
62  static void write(const IdentData& mzid,
63  const std::string& filename,
64  const WriteConfig& config = WriteConfig(),
65  const pwiz::util::IterationListenerRegistry* iterationListenerRegistry = 0);
66 
67  /// member write function
68  void write(const std::string& filename,
69  const WriteConfig& config = WriteConfig(),
70  const pwiz::util::IterationListenerRegistry* iterationListenerRegistry = 0);
71 
72  /// static write function for any IdentData object;
73  static void write(const IdentData& mzid,
74  const std::string& filename,
75  std::ostream& os,
76  const WriteConfig& config = WriteConfig(),
77  const pwiz::util::IterationListenerRegistry* iterationListenerRegistry = 0);
78 
79  /// member write function
80  void write(std::ostream& os,
81  const std::string& filename,
82  const WriteConfig& config = WriteConfig(),
83  const pwiz::util::IterationListenerRegistry* iterationListenerRegistry = 0);
84 };
85 
86 
87 PWIZ_API_DECL std::ostream& operator<<(std::ostream& os, IdentDataFile::Format format);
88 PWIZ_API_DECL std::ostream& operator<<(std::ostream& os, const IdentDataFile::WriteConfig& config);
89 
90 
91 } // namespace identdata
92 } // namespace pwiz
93 
94 
95 #endif // _IDENTDATAFILE_HPP_
pwiz::identdata::IdentDataFile::write
static void write(const IdentData &mzid, const std::string &filename, std::ostream &os, const WriteConfig &config=WriteConfig(), const pwiz::util::IterationListenerRegistry *iterationListenerRegistry=0)
static write function for any IdentData object;
IterationListener.hpp
pwiz
Definition: ChromatogramList_Filter.hpp:36
pwiz::identdata::IdentDataFile::write
void write(const std::string &filename, const WriteConfig &config=WriteConfig(), const pwiz::util::IterationListenerRegistry *iterationListenerRegistry=0)
member write function
pwiz::identdata::IdentDataFile::write
static void write(const IdentData &mzid, const std::string &filename, const WriteConfig &config=WriteConfig(), const pwiz::util::IterationListenerRegistry *iterationListenerRegistry=0)
static write function for any IdentData object;
pwiz::identdata::IdentDataFile::IdentDataFile
IdentDataFile(const std::string &filename, const Reader *reader=0, const pwiz::util::IterationListenerRegistry *iterationListenerRegistry=0, bool ignoreSequenceCollectionAndAnalysisData=false)
constructs IdentData object backed by file; reader==0 -> use DefaultReaderList
pwiz::identdata::IdentDataFile::write
void write(std::ostream &os, const std::string &filename, const WriteConfig &config=WriteConfig(), const pwiz::util::IterationListenerRegistry *iterationListenerRegistry=0)
member write function
PWIZ_API_DECL
#define PWIZ_API_DECL
Definition: Export.hpp:32
pwiz::identdata::Reader
interface for file readers
Definition: Reader.hpp:39
pwiz::identdata::IdentDataFile::WriteConfig
configuration for write()
Definition: IdentDataFile.hpp:53
Format_MzIdentML
Format_MzIdentML
Definition: IdentDataFile.hpp:49
Export.hpp
Format_Text
Format_Text
Definition: IdentDataFile.hpp:49
IdentData.hpp
pwiz::identdata::IdentDataFile::WriteConfig::format
Format format
Definition: IdentDataFile.hpp:54
pwiz::msdata::detail::Bruker::format
PWIZ_API_DECL Reader_Bruker_Format format(const std::string &path)
returns Bruker format of 'path' if it is a Bruker directory; otherwise returns empty string
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::IdentDataFile::WriteConfig::WriteConfig
WriteConfig(Format format=Format_MzIdentML)
Definition: IdentDataFile.hpp:56
pwiz::identdata::IdentDataFile
IdentData object plus file I/O.
Definition: IdentDataFile.hpp:40
Reader.hpp
pwiz::identdata::operator<<
PWIZ_API_DECL std::ostream & operator<<(std::ostream &os, const data::Diff< IdentData, DiffConfig > &diff)