ProteoWizard
ProteomeDataFile.hpp
Go to the documentation of this file.
1//
2// $Id$
3//
4//
5// Original author: Darren Kessner <darren@proteowizard.org>
6//
7// Copyright 2007 Spielberg Family Center for Applied Proteomics
8// Cedars-Sinai Medical Center, Los Angeles, California 90048
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 _PROTEOMEDATAFILE_HPP_
25#define _PROTEOMEDATAFILE_HPP_
26
27
29#include "ProteomeData.hpp"
30#include "Reader.hpp"
32
33
34namespace pwiz {
35namespace proteome {
36
37
38/// ProteomeData object plus file I/O
40{
41 /// constructs ProteomeData object backed by file;
42 /// indexed==true -> uses DefaultReaderList with indexing
43 ProteomeDataFile(const std::string& uri, bool indexed = false);
44
45 /// constructs ProteomeData object backed by file using the specified reader
46 ProteomeDataFile(const std::string& uri, const Reader& reader);
47
48 /// data format for write()
50
51 /// configuration for write()
53 {
54 Format format;
55 bool indexed;
56 bool gzipped; // if true, file is written as .gz
57
58 WriteConfig(Format _format = Format_FASTA, bool _gzipped = false)
59 : format(_format), indexed(true), gzipped(_gzipped)
60 {}
61 };
62
63 /// static write function for any ProteomeData object;
64 /// iterationListenerRegistry may be used for progress updates
65 static void write(const ProteomeData& pd,
66 const std::string& uri,
67 const WriteConfig& config = WriteConfig(),
68 const pwiz::util::IterationListenerRegistry* iterationListenerRegistry = 0);
69
70 /// member write function
71 void write(const std::string& uri,
72 const WriteConfig& config = WriteConfig(),
73 const pwiz::util::IterationListenerRegistry* iterationListenerRegistry = 0);
74};
75
76
77PWIZ_API_DECL std::ostream& operator<<(std::ostream& os, ProteomeDataFile::Format format);
78PWIZ_API_DECL std::ostream& operator<<(std::ostream& os, const ProteomeDataFile::WriteConfig& config);
79
80
81} // namespace proteome
82} // namespace pwiz
83
84
85#endif // _PROTEOMEDATAFILE_HPP_
86
#define PWIZ_API_DECL
Definition Export.hpp:32
Format_Text
interface for file readers
Definition Reader.hpp:37
handles registration of IterationListeners and broadcast of update messages
PWIZ_API_DECL std::ostream & operator<<(std::ostream &os, const data::Diff< ProteomeData, DiffConfig > &diff)
WriteConfig(Format _format=Format_FASTA, bool _gzipped=false)
ProteomeData object plus file I/O.
ProteomeDataFile(const std::string &uri, bool indexed=false)
constructs ProteomeData object backed by file; indexed==true -> uses DefaultReaderList with indexing
void write(const std::string &uri, const WriteConfig &config=WriteConfig(), const pwiz::util::IterationListenerRegistry *iterationListenerRegistry=0)
member write function
static void write(const ProteomeData &pd, const std::string &uri, const WriteConfig &config=WriteConfig(), const pwiz::util::IterationListenerRegistry *iterationListenerRegistry=0)
static write function for any ProteomeData object; iterationListenerRegistry may be used for progress...
ProteomeDataFile(const std::string &uri, const Reader &reader)
constructs ProteomeData object backed by file using the specified reader