ProteoWizard
MSDataFile.hpp
Go to the documentation of this file.
1 //
2 // $Id: MSDataFile.hpp 4009 2012-10-17 18:40:44Z kaipot $
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 
35 namespace pwiz {
36 namespace 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 
96 PWIZ_API_DECL std::ostream& operator<<(std::ostream& os, MSDataFile::Format format);
97 PWIZ_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 
Description of the source file, including location and type.
Definition: MSData.hpp:53
PWIZ_API_DECL std::ostream & operator<<(std::ostream &os, const BinaryDataEncoder::Config &config)
PWIZ_API_DECL void calculateSourceFileSHA1(SourceFile &sourceFile)
calculates and adds a CV term for the SHA1 checksum of a source file element
Format_MS1
Definition: MSDataFile.hpp:49
configuration for write()
Definition: MSDataFile.hpp:52
PWIZ_API_DECL void write(minimxml::XMLWriter &writer, const CV &cv)
Format_mzML
Definition: MSDataFile.hpp:49
#define PWIZ_API_DECL
Definition: Export.hpp:32
interface for file readers
Definition: Reader.hpp:37
Format_mzXML
Definition: MSDataFile.hpp:49
WriteConfig(Format _format=Format_mzML, bool _gzipped=false)
Definition: MSDataFile.hpp:59
PWIZ_API_DECL Reader_Bruker_Format format(const std::string &path)
returns Bruker format of &#39;path&#39; if it is a Bruker directory; otherwise returns empty string ...
MSData object plus file I/O.
Definition: MSDataFile.hpp:40
Format_CMS2
Definition: MSDataFile.hpp:49
encoding/decoding configuration
handles registration of IterationListeners and broadcast of update messages
Format_MGF
Definition: MSDataFile.hpp:49
BinaryDataEncoder::Config binaryDataEncoderConfig
Definition: MSDataFile.hpp:55
Format_CMS1
Definition: MSDataFile.hpp:49
PWIZ_API_DECL void calculateSHA1Checksums(const MSData &msd)
Iterate and calculate SHA-1 for all source files.
Format_MS2
Definition: MSDataFile.hpp:49
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition: MSData.hpp:845
Format_Text
Definition: MSDataFile.hpp:49