ProteoWizard
MSDataFile.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 _MSDATAFILE_HPP_
25#define _MSDATAFILE_HPP_
26
27
29#include "MSData.hpp"
30#include "Reader.hpp"
31#include "BinaryDataEncoder.hpp"
33
34
35namespace pwiz {
36namespace msdata {
37
38
39/// MSData object plus file I/O
41{
42 /// constructs MSData object backed by file;
43 /// reader==0 -> use DefaultReaderList
44 MSDataFile(const std::string& filename,
45 const Reader* reader = 0,
46 bool calculateSourceFileChecksum = false);
47
48 /// data format for write()
50
51 /// configuration for write()
53 {
54 Format format;
56 bool indexed;
57 bool gzipped; // if true, file is written as .gz
58
59 WriteConfig(Format _format = Format_mzML,bool _gzipped = false)
60 : format(_format), indexed(true), gzipped(_gzipped)
61 {}
62 };
63
64 /// static write function for any MSData object;
65 /// iterationListenerRegistry may be used for progress updates
66 static void write(const MSData& msd,
67 const std::string& filename,
68 const WriteConfig& config = WriteConfig(),
69 const pwiz::util::IterationListenerRegistry* iterationListenerRegistry = 0);
70
71 /// member write function
72 void write(const std::string& filename,
73 const WriteConfig& config = WriteConfig(),
74 const pwiz::util::IterationListenerRegistry* iterationListenerRegistry = 0);
75
76 /// static write function for any MSData object;
77 /// iterationListenerRegistry may be used for progress updates
78 static void write(const MSData& msd,
79 std::ostream& os,
80 const WriteConfig& config = WriteConfig(),
81 const pwiz::util::IterationListenerRegistry* iterationListenerRegistry = 0);
82
83 /// member write function
84 void write(std::ostream& os,
85 const WriteConfig& config = WriteConfig(),
86 const pwiz::util::IterationListenerRegistry* iterationListenerRegistry = 0);
87};
88
89
90/// calculates and adds a CV term for the SHA1 checksum of a source file element
92
93/// Iterate and calculate SHA-1 for all source files
95
96PWIZ_API_DECL std::ostream& operator<<(std::ostream& os, MSDataFile::Format format);
97PWIZ_API_DECL std::ostream& operator<<(std::ostream& os, const MSDataFile::WriteConfig& config);
98
99
100} // namespace msdata
101} // namespace pwiz
102
103
104#endif // _MSDATAFILE_HPP_
105
#define PWIZ_API_DECL
Definition Export.hpp:32
Format_Text
Format_MGF
Format_mzXML
Format_MS2
Format_MS1
Format_mzML
Format_CMS1
Format_CMS2
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
PWIZ_API_DECL void calculateSHA1Checksums(const MSData &msd)
Iterate and calculate SHA-1 for all source files.
PWIZ_API_DECL void calculateSourceFileSHA1(SourceFile &sourceFile)
calculates and adds a CV term for the SHA1 checksum of a source file element
encoding/decoding configuration
configuration for write()
BinaryDataEncoder::Config binaryDataEncoderConfig
WriteConfig(Format _format=Format_mzML, bool _gzipped=false)
MSData object plus file I/O.
void write(const std::string &filename, const WriteConfig &config=WriteConfig(), const pwiz::util::IterationListenerRegistry *iterationListenerRegistry=0)
member write function
static void write(const MSData &msd, std::ostream &os, const WriteConfig &config=WriteConfig(), const pwiz::util::IterationListenerRegistry *iterationListenerRegistry=0)
static write function for any MSData object; iterationListenerRegistry may be used for progress updat...
static void write(const MSData &msd, const std::string &filename, const WriteConfig &config=WriteConfig(), const pwiz::util::IterationListenerRegistry *iterationListenerRegistry=0)
static write function for any MSData object; iterationListenerRegistry may be used for progress updat...
void write(std::ostream &os, const WriteConfig &config=WriteConfig(), const pwiz::util::IterationListenerRegistry *iterationListenerRegistry=0)
member write function
MSDataFile(const std::string &filename, const Reader *reader=0, bool calculateSourceFileChecksum=false)
constructs MSData object backed by file; reader==0 -> use DefaultReaderList
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition MSData.hpp:850
Description of the source file, including location and type.
Definition MSData.hpp:55