ProteoWizard
TextWriter.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 _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  if (!chromatogram.precursor.empty())
390  child()(chromatogram.precursor);
391  if (!chromatogram.product.empty())
392  child()(chromatogram.product);
393  for_each(chromatogram.binaryDataArrayPtrs.begin(), chromatogram.binaryDataArrayPtrs.end(), child());
394  return *this;
395  }
396 
397  TextWriter& operator()(const Scan& scan)
398  {
399  (*this)("scan:");
400  if (!scan.spectrumID.empty()) child()("spectrumID: " + scan.spectrumID);
401  if (!scan.externalSpectrumID.empty()) child()("externalSpectrumID: " + scan.externalSpectrumID);
402  if (scan.sourceFilePtr) child()(*scan.sourceFilePtr);
403  if (scan.instrumentConfigurationPtr.get()) child()(*scan.instrumentConfigurationPtr);
404  child()(static_cast<const ParamContainer&>(scan));
405  if (!scan.scanWindows.empty())
406  child()("scanWindowList: ", scan.scanWindows);
407  return *this;
408  }
409 
411  {
412  (*this)("scanWindow:");
413  for_each(window.cvParams.begin(), window.cvParams.end(), child());
414  return *this;
415  }
416 
418  {
419  if (!p.get() || p->empty()) return *this;
420 
421  std::stringstream oss;
422  oss << "[" << boost::lexical_cast<std::string>(p->data.size()) << "] ";
423  oss.precision(12);
424  for (size_t i=0; i < arrayExampleCount_ && i < p->data.size(); i++)
425  oss << p->data[i] << " ";
426  if (p->data.size() > arrayExampleCount_)
427  oss << "...";
428 
429  (*this)("binaryDataArray:");
430  child() (static_cast<const ParamContainer&>(*p));
431  if (p->dataProcessingPtr.get() && !p->dataProcessingPtr->empty())
432  child()(p->dataProcessingPtr);
433  if (!p->data.empty())
434  child()("binary: " + oss.str());
435  return *this;
436  }
437 
438  TextWriter& operator()(const SelectedIon& selectedIon)
439  {
440  (*this)("selectedIon:");
441  child()(static_cast<const ParamContainer&>(selectedIon));
442  return *this;
443  }
444 
445  TextWriter& operator()(const Precursor& precursor)
446  {
447  (*this)("precursor:");
448  child()
449  ("spectrumRef: " + precursor.spectrumID)
450  (static_cast<const ParamContainer&>(precursor));
451 
452  if (!precursor.isolationWindow.empty())
453  {
454  child()("isolationWindow:");
455  child().child()(precursor.isolationWindow);
456  }
457 
458  if (!precursor.selectedIons.empty())
459  {
460  child()("selectedIons:", precursor.selectedIons);
461  }
462 
463  if (!precursor.activation.empty())
464  {
465  child()("activation:");
466  child().child()(precursor.activation);
467  }
468 
469  return *this;
470  }
471 
472  TextWriter& operator()(const Product& product)
473  {
474  (*this)("product:");
475 
476  if (!product.isolationWindow.empty())
477  {
478  child()("isolationWindow:");
479  child().child()(product.isolationWindow);
480  }
481 
482  return *this;
483  }
484 
485  TextWriter& operator()(const ScanList& scanList)
486  {
487  (*this)
488  (static_cast<const ParamContainer&>(scanList))
489  ("scanList:", scanList.scans);
490  return *this;
491  }
492 
493  // if no other overload matches, assume the object is a shared_ptr of a valid overloaded type
494  template<typename object_type>
495  TextWriter& operator()(const boost::shared_ptr<object_type>& p)
496  {
497  return p.get() ? (*this)(*p) : *this;
498  }
499 
500 
501  private:
502  std::ostream& os_;
503  int depth_;
505  std::string indent_;
506 };
507 
508 
509 } // namespace msdata
510 } // namespace pwiz
511 
512 
513 #endif // _TEXTWRITER_HPP_
514 
pwiz::data::UserParam
Uncontrolled user parameters (essentially allowing free text). Before using these,...
Definition: ParamTypes.hpp:186
pwiz::msdata::BinaryDataArrayPtr
boost::shared_ptr< BinaryDataArray > BinaryDataArrayPtr
Definition: MSData.hpp:417
pwiz::msdata::Sample::id
std::string id
a unique identifier across the samples with which to reference this sample description.
Definition: MSData.hpp:104
pwiz::msdata::ChromatogramIdentity::id
std::string id
a unique identifier for this chromatogram. It should be expected that external files may use this ide...
Definition: MSData.hpp:495
pwiz::cv::CV::fullName
std::string fullName
the usual name for the resource (e.g. The PSI-MS Controlled Vocabulary).
Definition: cv.hpp:14924
pwiz::msdata::Sample::name
std::string name
an optional name for the sample description, mostly intended as a quick mnemonic.
Definition: MSData.hpp:107
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const SpectrumList &spectrumList, bool metadata_only=false)
Definition: TextWriter.hpp:312
pwiz::data::UserParam::type
std::string type
the datatype of the parameter, where appropriate (e.g.: xsd:float).
Definition: ParamTypes.hpp:194
os_
ostream * os_
Definition: ChromatogramList_FilterTest.cpp:40
pwiz::msdata::SpectrumListPtr
boost::shared_ptr< SpectrumList > SpectrumListPtr
Definition: MSData.hpp:711
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const CVParam &cvParam)
Definition: TextWriter.hpp:64
pwiz::msdata::Chromatogram::binaryDataArrayPtrs
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
Definition: MSData.hpp:592
pwiz::msdata::Run::empty
bool empty() const
pwiz::msdata::InstrumentConfiguration::componentList
ComponentList componentList
list with the different components used in the mass spectrometer. At least one source,...
Definition: MSData.hpp:235
pwiz::msdata::TextWriter::indent_
std::string indent_
Definition: TextWriter.hpp:505
pwiz::msdata::MSData::softwarePtrs
std::vector< SoftwarePtr > softwarePtrs
list and descriptions of software used to acquire and/or process the data in this mzML file.
Definition: MSData.hpp:871
pwiz::msdata::Spectrum
The structure that captures the generation of a peak list (including the underlying acquisitions)
Definition: MSData.hpp:506
pwiz
Definition: ChromatogramList_Filter.hpp:36
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const Contact &contact)
Definition: TextWriter.hpp:175
pwiz::msdata::ChromatogramList::dataProcessingPtr
virtual const boost::shared_ptr< const DataProcessing > dataProcessingPtr() const
returns the data processing affecting spectra retrieved through this interface
pwiz::cv::CV
Information about an ontology or CV source and a short 'lookup' tag to refer to.
Definition: cv.hpp:14916
pwiz::cv::CV::URI
std::string URI
the URI for the resource.
Definition: cv.hpp:14921
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const Component &component)
Definition: TextWriter.hpp:222
pwiz::msdata::Software
A piece of software.
Definition: MSData.hpp:180
pwiz::msdata::ProcessingMethod
Description of the default peak processing method. This element describes the base method used in the...
Definition: MSData.hpp:255
pwiz::msdata::MSData::id
std::string id
an optional id for the mzML document. It is recommended to use LSIDs when possible.
Definition: MSData.hpp:855
pwiz::msdata::ProcessingMethod::softwarePtr
SoftwarePtr softwarePtr
this attribute MUST reference the 'id' of the appropriate SoftwareType.
Definition: MSData.hpp:260
pwiz::msdata::SourceFile
Description of the source file, including location and type.
Definition: MSData.hpp:55
pwiz::msdata::Product::isolationWindow
IsolationWindow isolationWindow
this element captures the isolation (or 'selection') window configured to isolate one or more precurs...
Definition: MSData.hpp:350
pwiz::msdata::SpectrumList::size
virtual size_t size() const =0
returns the number of spectra
pwiz::msdata::ScanSettings::sourceFilePtrs
std::vector< SourceFilePtr > sourceFilePtrs
container for a list of source file references.
Definition: MSData.hpp:212
pwiz::msdata::Run
A run in mzML should correspond to a single, consecutive and coherent set of scans on an instrument.
Definition: MSData.hpp:810
pwiz::msdata::SpectrumList::spectrum
virtual SpectrumPtr spectrum(size_t index, bool getBinaryData=false) const =0
retrieve a spectrum by index
MSData.hpp
pwiz::msdata::Chromatogram::defaultArrayLength
size_t defaultArrayLength
default length of binary data arrays contained in this element.
Definition: MSData.hpp:580
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const ProcessingMethod &processingMethod)
Definition: TextWriter.hpp:254
pwiz::msdata::Product
product ion information
Definition: MSData.hpp:348
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const ParamGroup &paramGroup)
Definition: TextWriter.hpp:182
pwiz::msdata::SpectrumIdentity::index
size_t index
the zero-based, consecutive index of the spectrum in the SpectrumList.
Definition: MSData.hpp:473
pwiz::data::ParamContainer::userParams
std::vector< UserParam > userParams
a collection of uncontrolled user terms
Definition: ParamTypes.hpp:253
pwiz::msdata::SourceFile::name
std::string name
name of the source file, without reference to location (either URI or local path).
Definition: MSData.hpp:60
pwiz::msdata::Contact
Structure allowing the use of a controlled (cvParam) or uncontrolled vocabulary (userParam),...
Definition: MSData.hpp:80
pwiz::msdata::ScanList
List and descriptions of scans.
Definition: MSData.hpp:396
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const Software &software)
Definition: TextWriter.hpp:244
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const SelectedIon &selectedIon)
Definition: TextWriter.hpp:438
pwiz::msdata::Scan::instrumentConfigurationPtr
InstrumentConfigurationPtr instrumentConfigurationPtr
this attribute MUST reference the 'id' attribute of the appropriate instrument configuration.
Definition: MSData.hpp:384
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const Precursor &precursor)
Definition: TextWriter.hpp:445
pwiz::cv::CV::id
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:14918
pwiz::msdata::FileDescription::sourceFilePtrs
std::vector< SourceFilePtr > sourceFilePtrs
list and descriptions of the source files this mzML document was generated or derived from.
Definition: MSData.hpp:90
pwiz::msdata::TextWriter::os_
std::ostream & os_
Definition: TextWriter.hpp:502
pwiz::data::UserParam::units
CVID units
an optional CV parameter for the unit term associated with the value, if any (e.g....
Definition: ParamTypes.hpp:197
pwiz::msdata::MSData::accession
std::string accession
an optional accession number for the mzML document.
Definition: MSData.hpp:852
pwiz::msdata::MSData::run
Run run
a run in mzML should correspond to a single, consecutive and coherent set of scans on an instrument.
Definition: MSData.hpp:886
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const SpectrumListPtr &p, bool metadata_only=false)
Definition: TextWriter.hpp:330
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const std::string &text)
Definition: TextWriter.hpp:58
pwiz::msdata::Scan::scanWindows
std::vector< ScanWindow > scanWindows
container for a list of select windows.
Definition: MSData.hpp:387
PWIZ_API_DECL
#define PWIZ_API_DECL
Definition: Export.hpp:32
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const Run &run, bool metadata_only=false)
Definition: TextWriter.hpp:292
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const ScanList &scanList)
Definition: TextWriter.hpp:485
pwiz::msdata::Product::empty
bool empty() const
returns true iff the element contains no params and all members are empty or null
pwiz::msdata::Run::defaultSourceFilePtr
SourceFilePtr defaultSourceFilePtr
default source file reference
Definition: MSData.hpp:824
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const FileDescription &fd)
Definition: TextWriter.hpp:137
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const Target &target)
Definition: TextWriter.hpp:275
pwiz::msdata::Chromatogram::dataProcessingPtr
DataProcessingPtr dataProcessingPtr
this attribute can optionally reference the 'id' of the appropriate dataProcessing.
Definition: MSData.hpp:583
pwiz::msdata::TextWriter::TextWriter
TextWriter(std::ostream &os, int depth=0, int arrayExampleCount=3)
constructs a TextWriter for MSData types
Definition: TextWriter.hpp:48
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const std::string &label, const std::vector< object_type > &v)
Definition: TextWriter.hpp:86
pwiz::msdata::DataProcessing::processingMethods
std::vector< ProcessingMethod > processingMethods
description of the default peak processing method(s). This element describes the base method used in ...
Definition: MSData.hpp:279
pwiz::cv::CV::version
std::string version
the version of the CV from which the referred-to terms are drawn.
Definition: cv.hpp:14927
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const DataProcessing &dp)
Definition: TextWriter.hpp:266
pwiz::msdata::Precursor::spectrumID
std::string spectrumID
reference to the id attribute of the spectrum from which the precursor was selected.
Definition: MSData.hpp:323
pwiz::msdata::Precursor::isolationWindow
IsolationWindow isolationWindow
this element captures the isolation (or 'selection') window configured to isolate one or more precurs...
Definition: MSData.hpp:326
pwiz::msdata::ScanList::empty
bool empty() const
pwiz::msdata::MSData::cvs
std::vector< CV > cvs
container for one or more controlled vocabulary definitions.
Definition: MSData.hpp:859
pwiz::msdata::ComponentList
List with the different components used in the mass spectrometer. At least one source,...
Definition: MSData.hpp:157
pwiz::data::ParamGroup
A collection of CVParam and UserParam elements that can be referenced from elsewhere in this mzML doc...
Definition: ParamTypes.hpp:347
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const Spectrum &spectrum)
Definition: TextWriter.hpp:358
pwiz::msdata::SourceFile::id
std::string id
an identifier for this file.
Definition: MSData.hpp:57
pwiz::msdata::Component::type
ComponentType type
the type of component (Source, Analyzer, or Detector)
Definition: MSData.hpp:134
Export.hpp
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const ParamContainer &paramContainer)
Definition: TextWriter.hpp:147
pwiz::msdata::ChromatogramListPtr
boost::shared_ptr< ChromatogramList > ChromatogramListPtr
Definition: MSData.hpp:785
pwiz::msdata::Component::order
int order
this attribute MUST be used to indicate the order in which the components are encountered from source...
Definition: MSData.hpp:137
pwiz::msdata::Chromatogram
A single chromatogram.
Definition: MSData.hpp:578
pwiz::msdata::Scan::spectrumID
std::string spectrumID
for scans that are local to this document, this attribute can be used to reference the 'id' attribute...
Definition: MSData.hpp:381
pwiz::data::CVParam::unitsName
std::string unitsName() const
convenience function to return string for the units
pwiz::data::ParamGroup::id
std::string id
the identifier with which to reference this ReferenceableParamGroup.
Definition: ParamTypes.hpp:349
pwiz::data::ParamContainer::empty
bool empty() const
returns true iff the element contains no params or param groups
pwiz::msdata::Spectrum::sourceFilePtr
SourceFilePtr sourceFilePtr
this attribute can optionally reference the 'id' of the appropriate sourceFile.
Definition: MSData.hpp:514
pwiz::msdata::ScanWindow
TODO.
Definition: MSData.hpp:362
pwiz::msdata::SpectrumIdentity::id
std::string id
a unique identifier for this spectrum. It should be expected that external files may use this identif...
Definition: MSData.hpp:476
pwiz::msdata::ScanSettings::targets
std::vector< Target > targets
target list (or 'inclusion list') configured prior to the run.
Definition: MSData.hpp:215
pwiz::cv::CVTermInfo::name
std::string name
Definition: cv.hpp:14947
pwiz::data::CVParam::units
CVID units
Definition: ParamTypes.hpp:48
pwiz::msdata::DataProcessing::id
std::string id
a unique identifier for this data processing that is unique across all DataProcessingTypes.
Definition: MSData.hpp:276
pwiz::msdata::Spectrum::dataProcessingPtr
DataProcessingPtr dataProcessingPtr
this attribute can optionally reference the 'id' of the appropriate dataProcessing.
Definition: MSData.hpp:511
pwiz::msdata::Run::id
std::string id
a unique identifier for this run.
Definition: MSData.hpp:812
pwiz::msdata::ComponentType_Detector
@ ComponentType_Detector
Definition: MSData.hpp:126
pwiz::msdata::ScanSettings::id
std::string id
a unique identifier for this acquisition setting.
Definition: MSData.hpp:209
pwiz::msdata::FileDescription::fileContent
FileContent fileContent
this summarizes the different types of spectra that can be expected in the file. This is expected to ...
Definition: MSData.hpp:87
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const ChromatogramListPtr &p, bool metadata_only=false)
Definition: TextWriter.hpp:353
pwiz::msdata::InstrumentConfiguration::id
std::string id
an identifier for this instrument configuration.
Definition: MSData.hpp:232
CVID_Unknown
CVID_Unknown
Definition: cv.hpp:114
pwiz::data::ParamContainer
The base class for elements that may contain cvParams, userParams, or paramGroup references.
Definition: ParamTypes.hpp:245
pwiz::msdata::MSData::fileDescription
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:862
pwiz::msdata::ComponentType_Source
@ ComponentType_Source
Definition: MSData.hpp:124
pwiz::msdata::SpectrumIdentity::spotID
std::string spotID
the identifier for the spot from which this spectrum was derived, if a MALDI or similar run.
Definition: MSData.hpp:479
pwiz::data::CVParam::value
std::string value
Definition: ParamTypes.hpp:47
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const ChromatogramList &chromatogramList, bool metadata_only=false)
Definition: TextWriter.hpp:335
pwiz::msdata::MSData::scanSettingsPtrs
std::vector< ScanSettingsPtr > scanSettingsPtrs
list with the descriptions of the acquisition settings applied prior to the start of data acquisition...
Definition: MSData.hpp:874
pwiz::msdata::Scan::sourceFilePtr
SourceFilePtr sourceFilePtr
if this attribute is set, it must reference the 'id' attribute of a sourceFile representing the exter...
Definition: MSData.hpp:373
pwiz::msdata::FileDescription::empty
bool empty() const
returns true iff all members are empty or null
pwiz::msdata::ChromatogramList::chromatogram
virtual ChromatogramPtr chromatogram(size_t index, bool getBinaryData=false) const =0
retrieve a chromatogram by index
pwiz::msdata::TextWriter
Definition: TextWriter.hpp:41
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const boost::shared_ptr< object_type > &p)
Definition: TextWriter.hpp:495
pwiz::msdata::FileDescription
Information pertaining to the entire mzML file (i.e. not specific to any part of the data set) is sto...
Definition: MSData.hpp:85
pwiz::data::UserParam::value
std::string value
the value for the parameter, where appropriate.
Definition: ParamTypes.hpp:191
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const InstrumentConfiguration &instrumentConfiguration)
Definition: TextWriter.hpp:201
pwiz::msdata::Software::version
std::string version
the software version.
Definition: MSData.hpp:185
pwiz::msdata::Component
A component of an instrument corresponding to a source (i.e. ion source), an analyzer (i....
Definition: MSData.hpp:132
pwiz::cv::cv
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
pwiz::msdata::ComponentType_Analyzer
@ ComponentType_Analyzer
Definition: MSData.hpp:125
pwiz::msdata::SourceFile::location
std::string location
URI-formatted location where the file was retrieved.
Definition: MSData.hpp:63
pwiz::msdata::Precursor::activation
Activation activation
the type and energy level used for activation.
Definition: MSData.hpp:332
pwiz::msdata::Spectrum::binaryDataArrayPtrs
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
Definition: MSData.hpp:526
pwiz::msdata::ScanSettings
Description of the acquisition settings of the instrument prior to the start of the run.
Definition: MSData.hpp:207
pwiz::msdata::FileDescription::contacts
std::vector< Contact > contacts
structure allowing the use of a controlled (cvParam) or uncontrolled vocabulary (userParam),...
Definition: MSData.hpp:93
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const Sample &sample)
Definition: TextWriter.hpp:191
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const Product &product)
Definition: TextWriter.hpp:472
pwiz::msdata::Software::id
std::string id
an identifier for this software that is unique across all SoftwareTypes.
Definition: MSData.hpp:182
pwiz::msdata::Spectrum::scanList
ScanList scanList
list of scans
Definition: MSData.hpp:517
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const UserParam &userParam)
Definition: TextWriter.hpp:75
pwiz::msdata::Scan
Scan or acquisition from original raw file used to create this peak list, as specified in sourceFile.
Definition: MSData.hpp:370
pwiz::msdata::Run::spectrumListPtr
SpectrumListPtr spectrumListPtr
all mass spectra and the acquisitions underlying them are described and attached here....
Definition: MSData.hpp:827
pwiz::msdata::ScanList::scans
std::vector< Scan > scans
Definition: MSData.hpp:397
pwiz::msdata::Run::startTimeStamp
std::string startTimeStamp
the optional start timestamp of the run, in UT.
Definition: MSData.hpp:821
pwiz::msdata::ChromatogramList::size
virtual size_t size() const =0
returns the number of chromatograms
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const ScanSettings &as)
Definition: TextWriter.hpp:282
pwiz::msdata::FileContent
This summarizes the different types of spectra that can be expected in the file. This is expected to ...
Definition: MSData.hpp:50
pwiz::msdata::Sample
Expansible description of the sample used to generate the dataset, named in sampleName.
Definition: MSData.hpp:102
pwiz::msdata::SelectedIon
TODO.
Definition: MSData.hpp:297
pwiz::msdata::MSData::samplePtrs
std::vector< SamplePtr > samplePtrs
list and descriptions of samples.
Definition: MSData.hpp:868
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const MSData &msd, bool metadata_only=false)
Definition: TextWriter.hpp:94
pwiz::msdata::TextWriter::depth_
int depth_
Definition: TextWriter.hpp:503
pwiz::msdata::Target
TODO.
Definition: MSData.hpp:202
pwiz::msdata::MSData::dataProcessingPtrs
std::vector< DataProcessingPtr > dataProcessingPtrs
list and descriptions of data processing applied to this data.
Definition: MSData.hpp:880
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const BinaryDataArrayPtr &p)
Definition: TextWriter.hpp:417
pwiz::msdata::TextWriter::arrayExampleCount_
size_t arrayExampleCount_
Definition: TextWriter.hpp:504
pwiz::data::ParamContainer::paramGroupPtrs
std::vector< ParamGroupPtr > paramGroupPtrs
a collection of references to ParamGroups
Definition: ParamTypes.hpp:247
pwiz::msdata::MSData::instrumentConfigurationPtrs
std::vector< InstrumentConfigurationPtr > instrumentConfigurationPtrs
list and descriptions of instrument configurations.
Definition: MSData.hpp:877
pwiz::cv::cvTermInfo
PWIZ_API_DECL const CVTermInfo & cvTermInfo(CVID cvid)
returns CV term info for the specified CVID
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const ComponentList &componentList)
Definition: TextWriter.hpp:214
pwiz::msdata::InstrumentConfiguration::softwarePtr
SoftwarePtr softwarePtr
reference to a previously defined software element.
Definition: MSData.hpp:238
pwiz::msdata::InstrumentConfiguration
Description of a particular hardware configuration of a mass spectrometer. Each configuration MUST ha...
Definition: MSData.hpp:230
pwiz::msdata::Spectrum::precursors
std::vector< Precursor > precursors
list and descriptions of precursors to the spectrum currently being described.
Definition: MSData.hpp:520
pwiz::msdata::MSData
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition: MSData.hpp:850
pwiz::msdata::DataProcessing
Description of the way in which a particular software was used.
Definition: MSData.hpp:274
pwiz::data::CVParam::cvid
CVID cvid
Definition: ParamTypes.hpp:46
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const Scan &scan)
Definition: TextWriter.hpp:397
pwiz::msdata::Precursor::empty
bool empty() const
returns true iff the element contains no params and all members are empty or null
pwiz::msdata::Run::samplePtr
SamplePtr samplePtr
this attribute MUST reference the 'id' of the appropriate sample.
Definition: MSData.hpp:818
pwiz::msdata::Precursor::selectedIons
std::vector< SelectedIon > selectedIons
this list of precursor ions that were selected.
Definition: MSData.hpp:329
pwiz::msdata::ChromatogramList
Interface for accessing chromatograms, which may be stored in memory or backed by a data file (RAW,...
Definition: MSData.hpp:757
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const CV &cv)
Definition: TextWriter.hpp:126
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const SourceFile &sf)
Definition: TextWriter.hpp:164
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const FileContent &fileContent)
Definition: TextWriter.hpp:157
pwiz::msdata::Precursor
The method of precursor ion selection and activation.
Definition: MSData.hpp:312
pwiz::msdata::Scan::externalSpectrumID
std::string externalSpectrumID
for scans that are external to this document, this string must correspond to the 'id' attribute of a ...
Definition: MSData.hpp:377
pwiz::msdata::Spectrum::defaultArrayLength
size_t defaultArrayLength
default length of binary data arrays contained in this element.
Definition: MSData.hpp:508
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const ScanWindow &window)
Definition: TextWriter.hpp:410
pwiz::data::CVParam
represents a tag-value pair, where the tag comes from the controlled vocabulary
Definition: ParamTypes.hpp:45
pwiz::msdata::Chromatogram::precursor
Precursor precursor
description of precursor ion information (i.e. Q1 settings)
Definition: MSData.hpp:586
pwiz::msdata::Run::defaultInstrumentConfigurationPtr
InstrumentConfigurationPtr defaultInstrumentConfigurationPtr
this attribute MUST reference the 'id' of the default instrument configuration. If a scan does not re...
Definition: MSData.hpp:815
pwiz::msdata::SpectrumList
Interface for accessing spectra, which may be stored in memory or backed by a data file (RAW,...
Definition: MSData.hpp:661
pwiz::msdata::MSData::version
const std::string & version() const
returns the version of this mzML document; for a document created programmatically,...
pwiz::msdata::TextWriter::operator()
TextWriter & operator()(const Chromatogram &chromatogram)
Definition: TextWriter.hpp:380
pwiz::msdata::SpectrumList::dataProcessingPtr
virtual const boost::shared_ptr< const DataProcessing > dataProcessingPtr() const
returns the data processing affecting spectra retrieved through this interface
pwiz::msdata::ProcessingMethod::order
int order
this attributes allows a series of consecutive steps to be placed in the correct order.
Definition: MSData.hpp:257
pwiz::msdata::ChromatogramIdentity::index
size_t index
the zero-based, consecutive index of the chromatogram in the ChromatogramList.
Definition: MSData.hpp:492
pwiz::data::UserParam::name
std::string name
the name for the parameter.
Definition: ParamTypes.hpp:188
pwiz::msdata::Chromatogram::product
Product product
description of product ion information (i.e. Q3 settings)
Definition: MSData.hpp:589
pwiz::msdata::Run::chromatogramListPtr
ChromatogramListPtr chromatogramListPtr
all chromatograms for this run.
Definition: MSData.hpp:830
pwiz::msdata::TextWriter::child
TextWriter child()
Definition: TextWriter.hpp:56
pwiz::msdata::MSData::paramGroupPtrs
std::vector< ParamGroupPtr > paramGroupPtrs
container for a list of referenceableParamGroups
Definition: MSData.hpp:865
pwiz::data::ParamContainer::cvParams
std::vector< CVParam > cvParams
a collection of controlled vocabulary terms
Definition: ParamTypes.hpp:250