ProteoWizard
TextWriter.hpp
Go to the documentation of this file.
1 //
2 // $Id: TextWriter.hpp 1880 2010-03-08 22:52:43Z chambm $
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 _TEXTWRITER_HPP_
25 #define _TEXTWRITER_HPP_
26 
27 
29 #include "MSData.hpp"
30 #include "boost/lexical_cast.hpp"
31 #include <iostream>
32 #include <string>
33 #include <vector>
34 
35 
36 namespace pwiz {
37 namespace msdata {
38 
39 
41 {
42  public:
43 
44  /// constructs a TextWriter for MSData types
45  /// @param os The ostream to write to.
46  /// @param depth The number of indentations to prefix to each output line.
47  /// @param arrayExampleCount The number of example values to print for arrays (i.e. m/z and intensity); -1 for unlimited
48  TextWriter(std::ostream& os, int depth = 0, int arrayExampleCount = 3)
49  : os_(os),
50  depth_(depth),
51  arrayExampleCount_(arrayExampleCount < 0 ? std::numeric_limits<size_t>::max()
52  : (size_t) arrayExampleCount),
53  indent_(depth*2, ' ')
54  {}
55 
56  TextWriter child() {return TextWriter(os_, depth_+1, arrayExampleCount_);}
57 
58  TextWriter& operator()(const std::string& text)
59  {
60  os_ << indent_ << text << std::endl;
61  return *this;
62  }
63 
64  TextWriter& operator()(const CVParam& cvParam)
65  {
66  os_ << indent_ << "cvParam: " << cvTermInfo(cvParam.cvid).name;
67  if (!cvParam.value.empty())
68  os_ << ", " << cvParam.value;
69  if (cvParam.units != CVID_Unknown)
70  os_ << ", " << cvParam.unitsName();
71  os_ << std::endl;
72  return *this;
73  }
74 
75  TextWriter& operator()(const UserParam& userParam)
76  {
77  os_ << indent_ << "userParam: " << userParam.name;
78  if (!userParam.value.empty()) os_ << ", " << userParam.value;
79  if (!userParam.type.empty()) os_ << ", " << userParam.type;
80  if (userParam.units != CVID_Unknown) os_ << ", " << cvTermInfo(userParam.units).name;
81  os_ << std::endl;
82  return *this;
83  }
84 
85  template<typename object_type>
86  TextWriter& operator()(const std::string& label, const std::vector<object_type>& v)
87  {
88  (*this)(label);
89  for_each(v.begin(), v.end(), child());
90  return *this;
91  }
92 
93 
94  TextWriter& operator()(const MSData& msd, bool metadata_only=false)
95  {
96  (*this)("msdata:");
97  child()
98  ("id: " + msd.id);
99  if (!msd.accession.empty())
100  child()("accession: " + msd.accession);
101  if (!msd.version().empty())
102  child()("version: " + msd.version());
103  if (!msd.cvs.empty())
104  child()("cvList: ", msd.cvs);
105  if (!msd.fileDescription.empty())
106  child()(msd.fileDescription);
107  if (!msd.paramGroupPtrs.empty())
108  child()("paramGroupList: ", msd.paramGroupPtrs);
109  if (!msd.samplePtrs.empty())
110  child()("sampleList: " , msd.samplePtrs);
111  if (!msd.softwarePtrs.empty())
112  child()("softwareList: ", msd.softwarePtrs);
113  if (!msd.scanSettingsPtrs.empty())
114  child()("scanSettingsList: ", msd.scanSettingsPtrs);
115  if (!msd.instrumentConfigurationPtrs.empty())
116  child()("instrumentConfigurationList: ", msd.instrumentConfigurationPtrs);
117  if (!msd.dataProcessingPtrs.empty())
118  child()("dataProcessingList: ", msd.dataProcessingPtrs);
119 
120  if (!msd.run.empty())
121  child()(msd.run, metadata_only);
122 
123  return *this;
124  }
125 
127  {
128  (*this)("cv:");
129  child()
130  ("id: " + cv.id)
131  ("fullName: " + cv.fullName)
132  ("version: " + cv.version)
133  ("URI: " + cv.URI);
134  return *this;
135  }
136 
138  {
139  (*this)("fileDescription:");
140  child()
141  (fd.fileContent)
142  ("sourceFileList: ", fd.sourceFilePtrs);
143  for_each(fd.contacts.begin(), fd.contacts.end(), child());
144  return *this;
145  }
146 
147  TextWriter& operator()(const ParamContainer& paramContainer)
148  {
149  for (std::vector<ParamGroupPtr>::const_iterator it=paramContainer.paramGroupPtrs.begin();
150  it!=paramContainer.paramGroupPtrs.end(); ++it)
151  (*this)("referenceableParamGroupRef: " + (*it)->id);
152  for_each(paramContainer.cvParams.begin(), paramContainer.cvParams.end(), *this);
153  for_each(paramContainer.userParams.begin(), paramContainer.userParams.end(), *this);
154  return *this;
155  }
156 
157  TextWriter& operator()(const FileContent& fileContent)
158  {
159  (*this)("fileContent:");
160  child()(static_cast<const ParamContainer&>(fileContent));
161  return *this;
162  }
163 
165  {
166  (*this)("sourceFile:");
167  child()
168  ("id: " + sf.id)
169  ("name: " + sf.name)
170  ("location: " + sf.location)
171  (static_cast<const ParamContainer&>(sf));
172  return *this;
173  }
174 
175  TextWriter& operator()(const Contact& contact)
176  {
177  (*this)("contact:");
178  child()(static_cast<const ParamContainer&>(contact));
179  return *this;
180  }
181 
182  TextWriter& operator()(const ParamGroup& paramGroup)
183  {
184  (*this)("paramGroup:");
185  child()
186  ("id: " + paramGroup.id)
187  (static_cast<const ParamContainer&>(paramGroup));
188  return *this;
189  }
190 
191  TextWriter& operator()(const Sample& sample)
192  {
193  (*this)("sample:");
194  child()
195  ("id: " + sample.id)
196  ("name: " + sample.name)
197  (static_cast<const ParamContainer&>(sample));
198  return *this;
199  }
200 
201  TextWriter& operator()(const InstrumentConfiguration& instrumentConfiguration)
202  {
203  (*this)("instrumentConfiguration:");
204  child()
205  ("id: " + instrumentConfiguration.id)
206  (static_cast<const ParamContainer&>(instrumentConfiguration));
207  if (!instrumentConfiguration.componentList.empty())
208  child()(instrumentConfiguration.componentList);
209  if (instrumentConfiguration.softwarePtr.get() && !instrumentConfiguration.softwarePtr->empty())
210  child()("softwareRef: " + instrumentConfiguration.softwarePtr->id);
211  return *this;
212  }
213 
214  TextWriter& operator()(const ComponentList& componentList)
215  {
216  (*this)("componentList:");
217  for (size_t i=0; i < componentList.size(); ++i)
218  child()(componentList[i]);
219  return *this;
220  }
221 
222  TextWriter& operator()(const Component& component)
223  {
224  switch(component.type)
225  {
227  (*this)("source: ");
228  break;
230  (*this)("analyzer: ");
231  break;
233  (*this)("detector: ");
234  break;
235  default:
236  break;
237  }
238  child()
239  ("order: " + boost::lexical_cast<std::string>(component.order))
240  (static_cast<const ParamContainer&>(component));
241  return *this;
242  }
243 
244  TextWriter& operator()(const Software& software)
245  {
246  (*this)("software:");
247  child()
248  ("id: " + software.id)
249  ("version: " + software.version)
250  (static_cast<const ParamContainer&>(software));
251  return *this;
252  }
253 
254  TextWriter& operator()(const ProcessingMethod& processingMethod)
255  {
256  (*this)("processingMethod:");
257  child()
258  ("order: " + boost::lexical_cast<std::string>(processingMethod.order));
259  if (processingMethod.softwarePtr.get() && !processingMethod.softwarePtr->empty())
260  child()("softwareRef: " + processingMethod.softwarePtr->id);
261  child()
262  (static_cast<const ParamContainer&>(processingMethod));
263  return *this;
264  }
265 
267  {
268  (*this)("dataProcessing:");
269  child()
270  ("id: " + dp.id);
271  for_each(dp.processingMethods.begin(), dp.processingMethods.end(), child());
272  return *this;
273  }
274 
275  TextWriter& operator()(const Target& target)
276  {
277  (*this)("target:");
278  child()(static_cast<const ParamContainer&>(target));
279  return *this;
280  }
281 
283  {
284  (*this)("scanSettings:");
285  child()
286  ("id: " + as.id);
287  for_each(as.targets.begin(), as.targets.end(), child());
288  child()("sourceFileList: ", as.sourceFilePtrs);
289  return *this;
290  }
291 
292  TextWriter& operator()(const Run& run, bool metadata_only=false)
293  {
294  (*this)("run:");
295  child()("id: " + run.id);
296  if (run.defaultInstrumentConfigurationPtr.get())
297  child()("defaultInstrumentConfigurationRef: " + run.defaultInstrumentConfigurationPtr->id);
298  if (run.samplePtr.get())
299  child()("sampleRef: " + run.samplePtr->id);
300  if (!run.startTimeStamp.empty())
301  child()("startTimeStamp: " + run.startTimeStamp);
302  child()(static_cast<const ParamContainer&>(run));
303  if (run.defaultSourceFilePtr.get())
304  child()("defaultSourceFileRef: " + run.defaultSourceFilePtr->id);
305  if (run.spectrumListPtr.get())
306  child()(run.spectrumListPtr, metadata_only);
307  if (run.chromatogramListPtr.get())
308  child()(run.chromatogramListPtr, metadata_only);
309  return *this;
310  }
311 
312  TextWriter& operator()(const SpectrumList& spectrumList, bool metadata_only=false)
313  {
314  std::string text("spectrumList (" + boost::lexical_cast<std::string>(spectrumList.size()) + " spectra)");
315  if (!metadata_only)
316  text += ":";
317 
318  (*this)(text);
319 
320  if (spectrumList.dataProcessingPtr().get())
321  child()(*spectrumList.dataProcessingPtr());
322 
323  if (!metadata_only)
324  for (size_t index=0; index<spectrumList.size(); ++index)
325  child()
326  (*spectrumList.spectrum(index, true));
327  return *this;
328  }
329 
330  TextWriter& operator()(const SpectrumListPtr& p, bool metadata_only=false)
331  {
332  return p.get() ? (*this)(*p, metadata_only) : *this;
333  }
334 
335  TextWriter& operator()(const ChromatogramList& chromatogramList, bool metadata_only=false)
336  {
337  std::string text("chromatogramList (" + boost::lexical_cast<std::string>(chromatogramList.size()) + " chromatograms)");
338  if (!metadata_only)
339  text += ":";
340 
341  (*this)(text);
342 
343  if (chromatogramList.dataProcessingPtr().get())
344  child()(*chromatogramList.dataProcessingPtr());
345 
346  if (!metadata_only)
347  for (size_t index=0; index<chromatogramList.size(); ++index)
348  child()
349  (*chromatogramList.chromatogram(index, true));
350  return *this;
351  }
352 
353  TextWriter& operator()(const ChromatogramListPtr& p, bool metadata_only=false)
354  {
355  return p.get() ? (*this)(*p, metadata_only) : *this;
356  }
357 
358  TextWriter& operator()(const Spectrum& spectrum)
359  {
360  (*this)("spectrum:");
361  child()
362  ("index: " + boost::lexical_cast<std::string>(spectrum.index))
363  ("id: " + spectrum.id);
364  if (!spectrum.spotID.empty())
365  child()("spotID: " + spectrum.spotID);
366  if (spectrum.sourceFilePtr.get())
367  child()(spectrum.sourceFilePtr);
368  child()
369  ("defaultArrayLength: " + boost::lexical_cast<std::string>(spectrum.defaultArrayLength))
370  (spectrum.dataProcessingPtr)
371  (static_cast<const ParamContainer&>(spectrum));
372  if (!spectrum.scanList.empty())
373  child()(spectrum.scanList);
374  if (!spectrum.precursors.empty())
375  child()("precursorList: ", spectrum.precursors);
376  for_each(spectrum.binaryDataArrayPtrs.begin(), spectrum.binaryDataArrayPtrs.end(), child());
377  return *this;
378  }
379 
380  TextWriter& operator()(const Chromatogram& chromatogram)
381  {
382  (*this)("chromatogram:");
383  child()
384  ("index: " + boost::lexical_cast<std::string>(chromatogram.index))
385  ("id: " + chromatogram.id)
386  ("defaultArrayLength: " + boost::lexical_cast<std::string>(chromatogram.defaultArrayLength))
387  (chromatogram.dataProcessingPtr)
388  (static_cast<const ParamContainer&>(chromatogram));
389  for_each(chromatogram.binaryDataArrayPtrs.begin(), chromatogram.binaryDataArrayPtrs.end(), child());
390  return *this;
391  }
392 
393  TextWriter& operator()(const Scan& scan)
394  {
395  (*this)("scan:");
396  if (scan.instrumentConfigurationPtr.get()) child()(*scan.instrumentConfigurationPtr);
397  child()(static_cast<const ParamContainer&>(scan));
398  if (!scan.scanWindows.empty())
399  child()("scanWindowList: ", scan.scanWindows);
400  return *this;
401  }
402 
404  {
405  (*this)("scanWindow:");
406  for_each(window.cvParams.begin(), window.cvParams.end(), child());
407  return *this;
408  }
409 
411  {
412  if (!p.get() || p->empty()) return *this;
413 
414  std::stringstream oss;
415  oss << "[" << boost::lexical_cast<std::string>(p->data.size()) << "] ";
416  oss.precision(12);
417  for (size_t i=0; i < arrayExampleCount_ && i < p->data.size(); i++)
418  oss << p->data[i] << " ";
419  if (p->data.size() > arrayExampleCount_)
420  oss << "...";
421 
422  (*this)("binaryDataArray:");
423  child() (static_cast<const ParamContainer&>(*p));
424  if (p->dataProcessingPtr.get() && !p->dataProcessingPtr->empty())
425  child()(p->dataProcessingPtr);
426  if (!p->data.empty())
427  child()("binary: " + oss.str());
428  return *this;
429  }
430 
431  TextWriter& operator()(const SelectedIon& selectedIon)
432  {
433  (*this)("selectedIon:");
434  child()(static_cast<const ParamContainer&>(selectedIon));
435  return *this;
436  }
437 
438  TextWriter& operator()(const Precursor& precursor)
439  {
440  (*this)("precursor:");
441  child()
442  ("spectrumRef: " + precursor.spectrumID)
443  (static_cast<const ParamContainer&>(precursor));
444 
445  if (!precursor.isolationWindow.empty())
446  {
447  child()("isolationWindow:");
448  child().child()(precursor.isolationWindow);
449  }
450 
451  if (!precursor.selectedIons.empty())
452  {
453  child()("selectedIons:", precursor.selectedIons);
454  }
455 
456  if (!precursor.activation.empty())
457  {
458  child()("activation:");
459  child().child()(precursor.activation);
460  }
461 
462  return *this;
463  }
464 
465  TextWriter& operator()(const Product& product)
466  {
467  (*this)("product:");
468 
469  if (!product.isolationWindow.empty())
470  {
471  child()("isolationWindow:");
472  child().child()(product.isolationWindow);
473  }
474 
475  return *this;
476  }
477 
478  TextWriter& operator()(const ScanList& scanList)
479  {
480  (*this)
481  (static_cast<const ParamContainer&>(scanList))
482  ("scanList:", scanList.scans);
483  return *this;
484  }
485 
486  // if no other overload matches, assume the object is a shared_ptr of a valid overloaded type
487  template<typename object_type>
488  TextWriter& operator()(const boost::shared_ptr<object_type>& p)
489  {
490  return p.get() ? (*this)(*p) : *this;
491  }
492 
493 
494  private:
495  std::ostream& os_;
496  int depth_;
498  std::string indent_;
499 };
500 
501 
502 } // namespace msdata
503 } // namespace pwiz
504 
505 
506 #endif // _TEXTWRITER_HPP_
507 
std::string id
the short label to be used as a reference tag with which to refer to this particular Controlled Vocab...
Definition: cv.hpp:13356
IsolationWindow isolationWindow
this element captures the isolation (or &#39;selection&#39;) window configured to isolate one or more precurs...
Definition: MSData.hpp:349
Structure allowing the use of a controlled (cvParam) or uncontrolled vocabulary (userParam), or a reference to a predefined set of these in this mzML file (paramGroupRef).
Definition: MSData.hpp:79
TextWriter & operator()(const MSData &msd, bool metadata_only=false)
Definition: TextWriter.hpp:94
This summarizes the different types of spectra that can be expected in the file. This is expected to ...
Definition: MSData.hpp:49
std::string value
Definition: ParamTypes.hpp:47
product ion information
Definition: MSData.hpp:346
Interface for accessing chromatograms, which may be stored in memory or backed by a data file (RAW...
Definition: MSData.hpp:752
PWIZ_API_DECL const CVTermInfo & cvTermInfo(CVID cvid)
returns CV term info for the specified CVID
std::string id
a unique identifier for this chromatogram. It should be expected that external files may use this ide...
Definition: MSData.hpp:494
TextWriter & operator()(const Product &product)
Definition: TextWriter.hpp:465
PWIZ_API_DECL const CV & cv(const std::string &prefix)
returns a CV object for the specified namespace (prefix); currently supported namespaces are: MS UO ...
std::vector< SourceFilePtr > sourceFilePtrs
list and descriptions of the source files this mzML document was generated or derived from...
Definition: MSData.hpp:89
Description of the way in which a particular software was used.
Definition: MSData.hpp:272
ComponentList componentList
list with the different components used in the mass spectrometer. At least one source, one mass analyzer and one detector need to be specified.
Definition: MSData.hpp:234
ScanList scanList
list of scans
Definition: MSData.hpp:516
TextWriter & operator()(const UserParam &userParam)
Definition: TextWriter.hpp:75
ostream * os_
TextWriter & operator()(const Scan &scan)
Definition: TextWriter.hpp:393
Description of the source file, including location and type.
Definition: MSData.hpp:53
Scan or acquisition from original raw file used to create this peak list, as specified in sourceFile...
Definition: MSData.hpp:368
std::vector< InstrumentConfigurationPtr > instrumentConfigurationPtrs
list and descriptions of instrument configurations.
Definition: MSData.hpp:873
The method of precursor ion selection and activation.
Definition: MSData.hpp:310
TextWriter & operator()(const ComponentList &componentList)
Definition: TextWriter.hpp:214
virtual const boost::shared_ptr< const DataProcessing > dataProcessingPtr() const
returns the data processing affecting spectra retrieved through this interface
ChromatogramListPtr chromatogramListPtr
all chromatograms for this run.
Definition: MSData.hpp:826
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
Definition: MSData.hpp:525
A component of an instrument corresponding to a source (i.e. ion source), an analyzer (i...
Definition: MSData.hpp:130
virtual const boost::shared_ptr< const DataProcessing > dataProcessingPtr() const
returns the data processing affecting spectra retrieved through this interface
SoftwarePtr softwarePtr
reference to a previously defined software element.
Definition: MSData.hpp:237
boost::shared_ptr< ChromatogramList > ChromatogramListPtr
Definition: MSData.hpp:781
TextWriter & operator()(const CVParam &cvParam)
Definition: TextWriter.hpp:64
TextWriter & operator()(const SourceFile &sf)
Definition: TextWriter.hpp:164
std::string value
the value for the parameter, where appropriate.
Definition: ParamTypes.hpp:191
TextWriter & operator()(const SpectrumListPtr &p, bool metadata_only=false)
Definition: TextWriter.hpp:330
TextWriter & operator()(const Spectrum &spectrum)
Definition: TextWriter.hpp:358
TextWriter & operator()(const boost::shared_ptr< object_type > &p)
Definition: TextWriter.hpp:488
std::string unitsName() const
convenience function to return string for the units
std::string name
an optional name for the sample description, mostly intended as a quick mnemonic. ...
Definition: MSData.hpp:106
STL namespace.
std::vector< ProcessingMethod > processingMethods
description of the default peak processing method(s). This element describes the base method used in ...
Definition: MSData.hpp:278
std::vector< Precursor > precursors
list and descriptions of precursors to the spectrum currently being described.
Definition: MSData.hpp:519
IsolationWindow isolationWindow
this element captures the isolation (or &#39;selection&#39;) window configured to isolate one or more precurs...
Definition: MSData.hpp:325
SoftwarePtr softwarePtr
this attribute MUST reference the &#39;id&#39; of the appropriate SoftwareType.
Definition: MSData.hpp:259
Information about an ontology or CV source and a short &#39;lookup&#39; tag to refer to.
Definition: cv.hpp:13353
size_t defaultArrayLength
default length of binary data arrays contained in this element.
Definition: MSData.hpp:576
ComponentType type
the type of component (Source, Analyzer, or Detector)
Definition: MSData.hpp:133
std::string id
an identifier for this file.
Definition: MSData.hpp:56
std::string name
name of the source file, without reference to location (either URI or local path).
Definition: MSData.hpp:59
std::string id
the identifier with which to reference this ReferenceableParamGroup.
Definition: ParamTypes.hpp:327
virtual SpectrumPtr spectrum(size_t index, bool getBinaryData=false) const =0
retrieve a spectrum by index
int order
this attribute MUST be used to indicate the order in which the components are encountered from source...
Definition: MSData.hpp:136
size_t index
the zero-based, consecutive index of the chromatogram in the ChromatogramList.
Definition: MSData.hpp:491
A single chromatogram.
Definition: MSData.hpp:573
FileDescription fileDescription
information pertaining to the entire mzML file (i.e. not specific to any part of the data set) is sto...
Definition: MSData.hpp:858
virtual size_t size() const =0
returns the number of spectra
std::string id
a unique identifier across the samples with which to reference this sample description.
Definition: MSData.hpp:103
TextWriter & operator()(const ProcessingMethod &processingMethod)
Definition: TextWriter.hpp:254
FileContent fileContent
this summarizes the different types of spectra that can be expected in the file. This is expected to ...
Definition: MSData.hpp:86
TextWriter & operator()(const ScanList &scanList)
Definition: TextWriter.hpp:478
TextWriter(std::ostream &os, int depth=0, int arrayExampleCount=3)
constructs a TextWriter for MSData types
Definition: TextWriter.hpp:48
std::vector< ScanSettingsPtr > scanSettingsPtrs
list with the descriptions of the acquisition settings applied prior to the start of data acquisition...
Definition: MSData.hpp:870
float lexical_cast(const std::string &str)
Interface for accessing spectra, which may be stored in memory or backed by a data file (RAW...
Definition: MSData.hpp:656
TextWriter & operator()(const SpectrumList &spectrumList, bool metadata_only=false)
Definition: TextWriter.hpp:312
std::string id
an optional id for the mzML document. It is recommended to use LSIDs when possible.
Definition: MSData.hpp:851
std::string id
a unique identifier for this run.
Definition: MSData.hpp:808
TextWriter & operator()(const DataProcessing &dp)
Definition: TextWriter.hpp:266
std::string fullName
the usual name for the resource (e.g. The PSI-MS Controlled Vocabulary).
Definition: cv.hpp:13362
SourceFilePtr defaultSourceFilePtr
default source file reference
Definition: MSData.hpp:820
Uncontrolled user parameters (essentially allowing free text). Before using these, one should verify whether there is an appropriate CV term available, and if so, use the CV term instead.
Definition: ParamTypes.hpp:185
std::string id
a unique identifier for this spectrum. It should be expected that external files may use this identif...
Definition: MSData.hpp:475
size_t defaultArrayLength
default length of binary data arrays contained in this element.
Definition: MSData.hpp:507
std::string location
URI-formatted location where the file was retrieved.
Definition: MSData.hpp:62
TextWriter & operator()(const std::string &text)
Definition: TextWriter.hpp:58
Description of the default peak processing method. This element describes the base method used in the...
Definition: MSData.hpp:253
TextWriter & operator()(const ScanWindow &window)
Definition: TextWriter.hpp:403
std::vector< UserParam > userParams
a collection of uncontrolled user terms
Definition: ParamTypes.hpp:253
Information pertaining to the entire mzML file (i.e. not specific to any part of the data set) is sto...
Definition: MSData.hpp:83
std::string spectrumID
reference to the id attribute of the spectrum from which the precursor was selected.
Definition: MSData.hpp:322
TextWriter & operator()(const ScanSettings &as)
Definition: TextWriter.hpp:282
bool empty() const
returns true iff all members are empty or null
int order
this attributes allows a series of consecutive steps to be placed in the correct order.
Definition: MSData.hpp:256
A run in mzML should correspond to a single, consecutive and coherent set of scans on an instrument...
Definition: MSData.hpp:805
std::string type
the datatype of the parameter, where appropriate (e.g.: xsd:float).
Definition: ParamTypes.hpp:194
Run run
a run in mzML should correspond to a single, consecutive and coherent set of scans on an instrument...
Definition: MSData.hpp:882
std::string accession
an optional accession number for the mzML document.
Definition: MSData.hpp:848
std::vector< Target > targets
target list (or &#39;inclusion list&#39;) configured prior to the run.
Definition: MSData.hpp:214
TextWriter & operator()(const ParamContainer &paramContainer)
Definition: TextWriter.hpp:147
std::string id
a unique identifier for this data processing that is unique across all DataProcessingTypes.
Definition: MSData.hpp:275
The base class for elements that may contain cvParams, userParams, or paramGroup references.
Definition: ParamTypes.hpp:244
Activation activation
the type and energy level used for activation.
Definition: MSData.hpp:331
std::string id
a unique identifier for this acquisition setting.
Definition: MSData.hpp:208
std::string URI
the URI for the resource.
Definition: cv.hpp:13359
std::vector< ScanWindow > scanWindows
container for a list of select windows.
Definition: MSData.hpp:386
TextWriter & operator()(const ParamGroup &paramGroup)
Definition: TextWriter.hpp:182
std::string version
the software version.
Definition: MSData.hpp:184
bool empty() const
returns true iff the element contains no params or param groups
std::vector< CVParam > cvParams
a collection of controlled vocabulary terms
Definition: ParamTypes.hpp:250
boost::shared_ptr< SpectrumList > SpectrumListPtr
Definition: MSData.hpp:707
std::vector< Contact > contacts
structure allowing the use of a controlled (cvParam) or uncontrolled vocabulary (userParam), or a reference to a predefined set of these in this mzML file (paramGroupRef)
Definition: MSData.hpp:92
TextWriter & operator()(const Sample &sample)
Definition: TextWriter.hpp:191
size_t index
the zero-based, consecutive index of the spectrum in the SpectrumList.
Definition: MSData.hpp:472
#define PWIZ_API_DECL
Definition: Export.hpp:32
std::vector< CV > cvs
container for one or more controlled vocabulary definitions.
Definition: MSData.hpp:855
std::vector< ParamGroupPtr > paramGroupPtrs
a collection of references to ParamGroups
Definition: ParamTypes.hpp:247
TextWriter & operator()(const ChromatogramList &chromatogramList, bool metadata_only=false)
Definition: TextWriter.hpp:335
std::string name
Definition: cv.hpp:13385
A piece of software.
Definition: MSData.hpp:178
std::string startTimeStamp
the optional start timestamp of the run, in UT.
Definition: MSData.hpp:817
std::string name
the name for the parameter.
Definition: ParamTypes.hpp:188
TextWriter & operator()(const Run &run, bool metadata_only=false)
Definition: TextWriter.hpp:292
TextWriter & operator()(const std::string &label, const std::vector< object_type > &v)
Definition: TextWriter.hpp:86
InstrumentConfigurationPtr instrumentConfigurationPtr
this attribute MUST reference the &#39;id&#39; attribute of the appropriate instrument configuration.
Definition: MSData.hpp:383
TextWriter & operator()(const Precursor &precursor)
Definition: TextWriter.hpp:438
List with the different components used in the mass spectrometer. At least one source, one mass analyzer and one detector need to be specified.
Definition: MSData.hpp:155
std::vector< SourceFilePtr > sourceFilePtrs
container for a list of source file references.
Definition: MSData.hpp:211
std::string spotID
the identifier for the spot from which this spectrum was derived, if a MALDI or similar run...
Definition: MSData.hpp:478
TextWriter & operator()(const SelectedIon &selectedIon)
Definition: TextWriter.hpp:431
A collection of CVParam and UserParam elements that can be referenced from elsewhere in this mzML doc...
Definition: ParamTypes.hpp:324
std::vector< SamplePtr > samplePtrs
list and descriptions of samples.
Definition: MSData.hpp:864
Description of a particular hardware configuration of a mass spectrometer. Each configuration MUST ha...
Definition: MSData.hpp:228
CVID units
an optional CV parameter for the unit term associated with the value, if any (e.g. MS_electron_volt).
Definition: ParamTypes.hpp:197
TextWriter & operator()(const FileDescription &fd)
Definition: TextWriter.hpp:137
std::vector< Scan > scans
Definition: MSData.hpp:396
std::vector< SelectedIon > selectedIons
this list of precursor ions that were selected.
Definition: MSData.hpp:328
TextWriter & operator()(const ChromatogramListPtr &p, bool metadata_only=false)
Definition: TextWriter.hpp:353
SpectrumListPtr spectrumListPtr
all mass spectra and the acquisitions underlying them are described and attached here. Subsidiary data arrays are also both described and attached here.
Definition: MSData.hpp:823
DataProcessingPtr dataProcessingPtr
this attribute can optionally reference the &#39;id&#39; of the appropriate dataProcessing.
Definition: MSData.hpp:579
std::vector< ParamGroupPtr > paramGroupPtrs
container for a list of referenceableParamGroups
Definition: MSData.hpp:861
TextWriter & operator()(const Chromatogram &chromatogram)
Definition: TextWriter.hpp:380
std::vector< SoftwarePtr > softwarePtrs
list and descriptions of software used to acquire and/or process the data in this mzML file...
Definition: MSData.hpp:867
Description of the acquisition settings of the instrument prior to the start of the run...
Definition: MSData.hpp:205
TextWriter & operator()(const BinaryDataArrayPtr &p)
Definition: TextWriter.hpp:410
TextWriter & operator()(const FileContent &fileContent)
Definition: TextWriter.hpp:157
std::vector< DataProcessingPtr > dataProcessingPtrs
list and descriptions of data processing applied to this data.
Definition: MSData.hpp:876
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
Definition: MSData.hpp:588
List and descriptions of scans.
Definition: MSData.hpp:394
CVID_Unknown
Definition: cv.hpp:97
TextWriter & operator()(const Component &component)
Definition: TextWriter.hpp:222
TextWriter & operator()(const Software &software)
Definition: TextWriter.hpp:244
Expansible description of the sample used to generate the dataset, named in sampleName.
Definition: MSData.hpp:100
virtual ChromatogramPtr chromatogram(size_t index, bool getBinaryData=false) const =0
retrieve a chromatogram by index
SourceFilePtr sourceFilePtr
this attribute can optionally reference the &#39;id&#39; of the appropriate sourceFile.
Definition: MSData.hpp:513
TextWriter & operator()(const InstrumentConfiguration &instrumentConfiguration)
Definition: TextWriter.hpp:201
TextWriter & operator()(const Target &target)
Definition: TextWriter.hpp:275
DataProcessingPtr dataProcessingPtr
this attribute can optionally reference the &#39;id&#39; of the appropriate dataProcessing.
Definition: MSData.hpp:510
The structure that captures the generation of a peak list (including the underlying acquisitions) ...
Definition: MSData.hpp:504
std::string version
the version of the CV from which the referred-to terms are drawn.
Definition: cv.hpp:13365
SamplePtr samplePtr
this attribute MUST reference the &#39;id&#39; of the appropriate sample.
Definition: MSData.hpp:814
const std::string & version() const
returns the version of this mzML document; for a document created programmatically, the version is the current release version of mzML; for a document created from a file/stream, the version is the schema version read from the file/stream
virtual size_t size() const =0
returns the number of chromatograms
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition: MSData.hpp:845
bool empty() const
std::string id
an identifier for this instrument configuration.
Definition: MSData.hpp:231
TextWriter & operator()(const CV &cv)
Definition: TextWriter.hpp:126
TextWriter & operator()(const Contact &contact)
Definition: TextWriter.hpp:175
boost::shared_ptr< BinaryDataArray > BinaryDataArrayPtr
Definition: MSData.hpp:416
represents a tag-value pair, where the tag comes from the controlled vocabulary
Definition: ParamTypes.hpp:44
std::string id
an identifier for this software that is unique across all SoftwareTypes.
Definition: MSData.hpp:181
InstrumentConfigurationPtr defaultInstrumentConfigurationPtr
this attribute MUST reference the &#39;id&#39; of the default instrument configuration. If a scan does not re...
Definition: MSData.hpp:811