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
34namespace pwiz {
35namespace 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
87PWIZ_API_DECL std::ostream& operator<<(std::ostream& os, IdentDataFile::Format format);
88PWIZ_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_
#define PWIZ_API_DECL
Definition Export.hpp:32
Format_MzIdentML
Format_Text
interface for file readers
Definition Reader.hpp:39
handles registration of IterationListeners and broadcast of update messages
std::ostream & operator<<(std::ostream &os, const Diff< object_type, config_type > &diff)
stream insertion of Diff results
Definition diff_std.hpp:200
WriteConfig(Format format=Format_MzIdentML)
IdentData object plus file I/O.
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;
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;
void write(std::ostream &os, const std::string &filename, const WriteConfig &config=WriteConfig(), const pwiz::util::IterationListenerRegistry *iterationListenerRegistry=0)
member write function
void write(const std::string &filename, const WriteConfig &config=WriteConfig(), const pwiz::util::IterationListenerRegistry *iterationListenerRegistry=0)
member write function
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
Implementation of the MzIdentMLType from the mzIdentML schema.