ProteoWizard
MSData.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 _MSDATA_HPP_
25#define _MSDATA_HPP_
26
27
31#include "boost/shared_ptr.hpp"
32#include "boost/iostreams/positioning.hpp"
33#include <vector>
34#include <string>
35#include <map>
36#include <set>
37
38
39namespace pwiz {
40namespace msdata {
41
42
43 using namespace pwiz::data;
44
45
46PWIZ_API_DECL std::vector<CV> defaultCVList();
47
48
49/// This summarizes the different types of spectra that can be expected in the file. This is expected to aid processing software in skipping files that do not contain appropriate spectrum types for it.
51
52
53/// Description of the source file, including location and type.
55{
56 /// an identifier for this file.
57 std::string id;
58
59 /// name of the source file, without reference to location (either URI or local path).
60 std::string name;
61
62 /// URI-formatted location where the file was retrieved.
63 std::string location;
64
65 SourceFile(const std::string _id = "",
66 const std::string _name = "",
67 const std::string _location = "");
68
69
70 /// returns true iff the element contains no params and all members are empty or null
71 bool empty() const;
72};
73
74
75/// Description of the source file, including location and type.
76typedef boost::shared_ptr<SourceFile> SourceFilePtr;
77
78
79/// 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).
81
82
83/// Information pertaining to the entire mzML file (i.e. not specific to any part of the data set) is stored here.
85{
86 /// this summarizes the different types of spectra that can be expected in the file. This is expected to aid processing software in skipping files that do not contain appropriate spectrum types for it.
88
89 /// list and descriptions of the source files this mzML document was generated or derived from.
90 std::vector<SourceFilePtr> sourceFilePtrs;
91
92 /// 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)
93 std::vector<Contact> contacts;
94
95 /// returns true iff all members are empty or null
96 bool empty() const;
97};
98
99
100/// Expansible description of the sample used to generate the dataset, named in sampleName.
102{
103 /// a unique identifier across the samples with which to reference this sample description.
104 std::string id;
105
106 /// an optional name for the sample description, mostly intended as a quick mnemonic.
107 std::string name;
108
109 Sample(const std::string _id = "",
110 const std::string _name = "");
111
112
113 /// returns true iff the element contains no params and all members are empty or null
114 bool empty() const;
115};
116
117
118typedef boost::shared_ptr<Sample> SamplePtr;
119
120
128
129
130/// A component of an instrument corresponding to a source (i.e. ion source), an analyzer (i.e. mass analyzer), or a detector (i.e. ion detector)
132{
133 /// the type of component (Source, Analyzer, or Detector)
135
136 /// this attribute MUST be used to indicate the order in which the components are encountered from source to detector (e.g., in a Q-TOF, the quadrupole would have the lower order number, and the TOF the higher number of the two).
137 int order;
138
139 Component() : type(ComponentType_Unknown), order(0) {}
140 Component(ComponentType type, int order) : type(type), order(order) {}
141 Component(CVID cvid, int order) { define(cvid, order); }
142
143 void define(CVID cvid, int order);
144
145 /// returns true iff the element contains no params and all members are empty or null
146 bool empty() const;
147};
148
149
150//struct PWIZ_API_DECL Source : public Component {};
151//struct PWIZ_API_DECL Analyzer : public Component {};
152//struct PWIZ_API_DECL Detector : public Component {};
153
154
155/// List with the different components used in the mass spectrometer. At least one source, one mass analyzer and one detector need to be specified.
156struct PWIZ_API_DECL ComponentList : public std::vector<Component>
157{
158 /// returns the source component with ordinal <index+1>
159 Component& source(size_t index);
160
161 /// returns the analyzer component with ordinal <index+1>
162 Component& analyzer(size_t index);
163
164 /// returns the detector component with ordinal <index+1>
165 Component& detector(size_t index);
166
167 /// returns the source component with ordinal <index+1>
168 const Component& source(size_t index) const;
169
170 /// returns the analyzer component with ordinal <index+1>
171 const Component& analyzer(size_t index) const;
172
173 /// returns the detector component with ordinal <index+1>
174 const Component& detector(size_t index) const;
175};
176
177
178/// A piece of software.
180{
181 /// an identifier for this software that is unique across all SoftwareTypes.
182 std::string id;
183
184 /// the software version.
185 std::string version;
186
187 Software(const std::string& _id = "");
188
189 Software(const std::string& _id,
190 const CVParam& _param,
191 const std::string& _version);
192
193 /// returns true iff all members are empty or null
194 bool empty() const;
195};
196
197
198typedef boost::shared_ptr<Software> SoftwarePtr;
199
200
201/// TODO
203
204
205/// Description of the acquisition settings of the instrument prior to the start of the run.
207{
208 /// a unique identifier for this acquisition setting.
209 std::string id;
210
211 /// container for a list of source file references.
212 std::vector<SourceFilePtr> sourceFilePtrs;
213
214 /// target list (or 'inclusion list') configured prior to the run.
215 std::vector<Target> targets;
216
217 ScanSettings(const std::string& _id = "");
218
219
220 /// returns true iff the element contains no params and all members are empty or null
221 bool empty() const;
222};
223
224
225typedef boost::shared_ptr<ScanSettings> ScanSettingsPtr;
226
227
228/// Description of a particular hardware configuration of a mass spectrometer. Each configuration MUST have one (and only one) of the three different components used for an analysis. For hybrid instruments, such as an LTQ-FT, there MUST be one configuration for each permutation of the components that is used in the document. For software configuration, reference the appropriate ScanSettings element.
230{
231 /// an identifier for this instrument configuration.
232 std::string id;
233
234 /// list with the different components used in the mass spectrometer. At least one source, one mass analyzer and one detector need to be specified.
236
237 /// reference to a previously defined software element.
239
240 /// reference to a scan settings element defining global scan settings used by this configuration
242
243 InstrumentConfiguration(const std::string& _id = "");
244
245 /// returns true iff the element contains no params and all members are empty or null
246 bool empty() const;
247};
248
249
250typedef boost::shared_ptr<InstrumentConfiguration> InstrumentConfigurationPtr;
251
252
253/// Description of the default peak processing method. This element describes the base method used in the generation of a particular mzML file. Variable methods should be described in the appropriate acquisition section - if no acquisition-specific details are found, then this information serves as the default.
255{
256 /// this attributes allows a series of consecutive steps to be placed in the correct order.
257 int order;
258
259 /// this attribute MUST reference the 'id' of the appropriate SoftwareType.
261
262 ProcessingMethod() : order(0) {}
263
264 /// returns true iff the element contains no params and all members are empty or null
265 bool empty() const;
266};
267
268
269typedef boost::shared_ptr<ProcessingMethod> ProcessingMethodPtr;
270
271
272/// Description of the way in which a particular software was used.
274{
275 /// a unique identifier for this data processing that is unique across all DataProcessingTypes.
276 std::string id;
277
278 /// description of the default peak processing method(s). This element describes the base method used in the generation of a particular mzML file. Variable methods should be described in the appropriate acquisition section - if no acquisition-specific details are found, then this information serves as the default.
279 std::vector<ProcessingMethod> processingMethods;
280
281 DataProcessing(const std::string& _id = "");
282
283 /// returns true iff the element contains no params and all members are empty or null
284 bool empty() const;
285};
286
287
288typedef boost::shared_ptr<DataProcessing> DataProcessingPtr;
289
290
291/// This element captures the isolation (or 'selection') window configured to isolate one or more precursors.
293
294
295/// TODO
297{
299 explicit SelectedIon(double mz);
300 explicit SelectedIon(double mz, double intensity, CVID intensityUnit);
301 explicit SelectedIon(double mz, int chargeState);
302 explicit SelectedIon(double mz, double intensity, int chargeState, CVID intensityUnit);
303};
304
305
306/// The type and energy level used for activation.
308
309
310/// The method of precursor ion selection and activation
312{
313 /// for precursor spectra that are external to this document, this attribute MUST reference the 'id' attribute of a sourceFile representing that external document.
314 /// note: this attribute is mutually exclusive with spectrumID; i.e. use one or the other but not both
316
317 /// for precursor spectra that are external to this document, this string MUST correspond to the 'id' attribute of a spectrum in the external document indicated by 'sourceFileRef'.
318 /// note: this attribute is mutually exclusive with spectrumID; i.e. use one or the other but not both
320
321 /// reference to the id attribute of the spectrum from which the precursor was selected.
322 /// note: this attribute is mutually exclusive with externalSpectrumID; i.e. use one or the other but not both
323 std::string spectrumID;
324
325 /// this element captures the isolation (or 'selection') window configured to isolate one or more precursors.
327
328 /// this list of precursor ions that were selected.
329 std::vector<SelectedIon> selectedIons;
330
331 /// the type and energy level used for activation.
333
335 explicit Precursor(double mz);
336 explicit Precursor(double mz, double intensity, CVID intensityUnit);
337 explicit Precursor(double mz, int chargeState);
338 explicit Precursor(double mz, double intensity, int chargeState, CVID intensityUnit);
339
340
341 /// returns true iff the element contains no params and all members are empty or null
342 bool empty() const;
343};
344
345
346/// product ion information
348{
349 /// this element captures the isolation (or 'selection') window configured to isolate one or more precursors.
351
352 /// returns true iff the element contains no params and all members are empty or null
353 bool empty() const;
354
355 /// returns true iff this product's isolation window is equal to that product's
356 bool operator==(const Product& that) const;
357};
358
359
360/// TODO
362{
364 ScanWindow(double low, double high, CVID unit);
365};
366
367
368/// Scan or acquisition from original raw file used to create this peak list, as specified in sourceFile.
370{
371 /// if this attribute is set, it must reference the 'id' attribute of a sourceFile representing the external document containing the spectrum referred to by 'externalSpectrumID'.
372 /// note: this attribute is mutually exclusive with spectrumID; i.e. use one or the other but not both
374
375 /// for scans that are external to this document, this string must correspond to the 'id' attribute of a spectrum in the external document indicated by 'sourceFileRef'.
376 /// note: this attribute is mutually exclusive with spectrumID; i.e. use one or the other but not both
378
379 /// for scans that are local to this document, this attribute can be used to reference the 'id' attribute of the spectrum corresponding to the scan.
380 /// note: this attribute is mutually exclusive with externalSpectrumID; i.e. use one or the other but not both
381 std::string spectrumID;
382
383 /// this attribute MUST reference the 'id' attribute of the appropriate instrument configuration.
385
386 /// container for a list of select windows.
387 std::vector<ScanWindow> scanWindows;
388
389 /// returns true iff the element contains no params and all members are empty or null
390 bool empty() const;
391};
392
393
394/// List and descriptions of scans.
396{
397 std::vector<Scan> scans;
398
399 bool empty() const;
400};
401
402
403/// The structure into which encoded binary data goes. Byte ordering is always little endian (Intel style). Computers using a different endian style MUST convert to/from little endian when writing/reading mzML
405{
406 /// this optional attribute may reference the 'id' attribute of the appropriate dataProcessing.
408
409 /// the binary data.
411
412 /// returns true iff the element contains no params and all members are empty or null
413 bool empty() const;
414};
415
416
417typedef boost::shared_ptr<BinaryDataArray> BinaryDataArrayPtr;
418
419
420#pragma pack(1)
421/// The data point type of a mass spectrum.
423{
424 double mz;
425 double intensity;
426
428 : mz(0), intensity(0)
429 {}
430
431 MZIntensityPair(double mz, double intensity)
432 : mz(mz), intensity(intensity)
433 {}
434
435 /// returns true iff mz and intensity are pairwise equal
436 bool operator==(const MZIntensityPair& that) const;
437};
438#pragma pack()
439
440
441PWIZ_API_DECL std::ostream& operator<<(std::ostream& os, const MZIntensityPair& mzi);
442
443
444#pragma pack(1)
445/// The data point type of a chromatogram.
447{
448 double time;
449 double intensity;
450
452 : time(0), intensity(0)
453 {}
454
455 TimeIntensityPair(double time, double intensity)
456 : time(time), intensity(intensity)
457 {}
458
459 /// returns true iff time and intensity are pairwise equal
460 bool operator==(const TimeIntensityPair& that) const;
461};
462#pragma pack()
463
464
465PWIZ_API_DECL std::ostream& operator<<(std::ostream& os, const TimeIntensityPair& ti);
466
467const size_t IDENTITY_INDEX_NONE = (size_t)-1;
468
469/// Identifying information for a spectrum
471{
472 /// the zero-based, consecutive index of the spectrum in the SpectrumList.
473 size_t index;
474
475 /// a unique identifier for this spectrum. It should be expected that external files may use this identifier together with the mzML filename or accession to reference a particular spectrum.
476 std::string id;
477
478 /// the identifier for the spot from which this spectrum was derived, if a MALDI or similar run.
479 std::string spotID;
480
481 /// for file-based MSData implementations, this attribute may refer to the spectrum's position in the file
482 boost::iostreams::stream_offset sourceFilePosition;
483
484
485 SpectrumIdentity() : index(IDENTITY_INDEX_NONE), sourceFilePosition((boost::iostreams::stream_offset)-1) {}
486};
487
488/// Identifying information for a chromatogram
490{
491 /// the zero-based, consecutive index of the chromatogram in the ChromatogramList.
492 size_t index;
493
494 /// a unique identifier for this chromatogram. It should be expected that external files may use this identifier together with the mzML filename or accession to reference a particular chromatogram.
495 std::string id;
496
497 /// for file-based MSData implementations, this attribute may refer to the chromatogram's position in the file
498 boost::iostreams::stream_offset sourceFilePosition;
499
500 ChromatogramIdentity() : index(IDENTITY_INDEX_NONE), sourceFilePosition(-1) {}
501};
502
503
504/// The structure that captures the generation of a peak list (including the underlying acquisitions)
506{
507 /// default length of binary data arrays contained in this element.
509
510 /// this attribute can optionally reference the 'id' of the appropriate dataProcessing.
512
513 /// this attribute can optionally reference the 'id' of the appropriate sourceFile.
515
516 /// list of scans
518
519 /// list and descriptions of precursors to the spectrum currently being described.
520 std::vector<Precursor> precursors;
521
522 /// list and descriptions of product ion information
523 std::vector<Product> products;
524
525 /// list of binary data arrays.
526 std::vector<BinaryDataArrayPtr> binaryDataArrayPtrs;
527
528
529 Spectrum() : defaultArrayLength(0) {}
530
531 /// returns true iff the element contains no params and all members are empty or null
532 bool empty() const;
533
534 /// returns true iff has nonnull and nonempty BinaryDataArrayPtr
535 bool hasBinaryData() const {
536 return binaryDataArrayPtrs.size() &&
537 binaryDataArrayPtrs[0] &&
538 !binaryDataArrayPtrs[0]->data.empty();
539 };
540
541 /// copy binary data arrays into m/z-intensity pair array
542 void getMZIntensityPairs(std::vector<MZIntensityPair>& output) const;
543
544 /// copy binary data arrays into m/z-intensity pair array
545 /// note: this overload is to allow client to allocate own buffer; the client
546 /// must determine the correct size beforehand, or an exception will be thrown
547 void getMZIntensityPairs(MZIntensityPair* output, size_t expectedSize) const;
548
549 /// get m/z array (may be null)
551
552 /// get intensity array (may be null)
554
555 /// get array with specified CVParam (may be null)
556 BinaryDataArrayPtr getArrayByCVID(CVID arrayType) const;
557
558 /// set binary data arrays
559 void setMZIntensityPairs(const std::vector<MZIntensityPair>& input, CVID intensityUnits);
560
561 /// set binary data arrays
562 void setMZIntensityPairs(const MZIntensityPair* input, size_t size, CVID intensityUnits);
563
564 /// set m/z and intensity arrays separately (they must be the same size)
565 void setMZIntensityArrays(const std::vector<double>& mzArray, const std::vector<double>& intensityArray, CVID intensityUnits);
566
567 /// set m/z and intensity arrays separately (they must be the same size) by swapping the vector contents
568 /// this allows for a more nearly zero copy setup. Contents of mzArray and intensityArray are undefined after calling.
569 void swapMZIntensityArrays(pwiz::util::BinaryData<double>& mzArray, pwiz::util::BinaryData<double>& intensityArray, CVID intensityUnits);
570};
571
572
573typedef boost::shared_ptr<Spectrum> SpectrumPtr;
574
575
576/// A single chromatogram.
578{
579 /// default length of binary data arrays contained in this element.
581
582 /// this attribute can optionally reference the 'id' of the appropriate dataProcessing.
584
585 /// description of precursor ion information (i.e. Q1 settings)
587
588 /// description of product ion information (i.e. Q3 settings)
590
591 /// list of binary data arrays.
592 std::vector<BinaryDataArrayPtr> binaryDataArrayPtrs;
593
594 Chromatogram() : defaultArrayLength(0) {}
595
596 /// returns true iff the element contains no params and all members are empty or null
597 bool empty() const;
598
599 /// copy binary data arrays into time-intensity pair array
600 void getTimeIntensityPairs(std::vector<TimeIntensityPair>& output) const;
601
602 /// copy binary data arrays into time-intensity pair array
603 /// note: this overload is to allow client to allocate own buffer; the client
604 /// must determine the correct size beforehand, or an exception will be thrown
605 void getTimeIntensityPairs(TimeIntensityPair* output, size_t expectedSize) const;
606
607 /// get time array (may be null)
609
610 /// get intensity array (may be null)
612
613 /// set binary data arrays
614 void setTimeIntensityPairs(const std::vector<TimeIntensityPair>& input, CVID timeUnits, CVID intensityUnits);
615
616 /// set binary data arrays
617 void setTimeIntensityPairs(const TimeIntensityPair* input, size_t size, CVID timeUnits, CVID intensityUnits);
618
619 /// set time and intensity arrays separately (they must be the same size)
620 void setTimeIntensityArrays(const std::vector<double>& timeArray, const std::vector<double>& intensityArray, CVID timeUnits, CVID intensityUnits);
621};
622
623
624typedef boost::shared_ptr<Chromatogram> ChromatogramPtr;
625
626
627// note: derived container to support dynamic linking on Windows
628class IndexList : public std::vector<size_t> {};
629
637
638///
639/// Interface for accessing spectra, which may be stored in memory
640/// or backed by a data file (RAW, mzXML, mzML).
641///
642/// Implementation notes:
643///
644/// - Implementations are expected to keep a spectrum index in the form of
645/// vector<SpectrumIdentity> or equivalent. The default find*() functions search
646/// the index linearly. Implementations may provide constant time indexing.
647///
648/// - The semantics of spectrum() may vary slightly with implementation. In particular,
649/// a SpectrumList implementation that is backed by a file may choose either to cache
650/// or discard the SpectrumPtrs for future access, with the caveat that the client
651/// may write to the underlying data.
652///
653/// - It is the implementation's responsibility to return a valid SpectrumPtr from spectrum().
654/// If this cannot be done, an exception must be thrown.
655///
656/// - The 'getBinaryData' flag is a hint if false : implementations may provide valid
657/// BinaryDataArrayPtrs on spectrum(index, false); implementations *must* provide
658/// valid BinaryDataArrayPtrs on spectrum(index, true).
659///
661{
662 public:
663
664 /// returns the number of spectra
665 virtual size_t size() const = 0;
666
667 /// returns true iff (size() == 0) and (dataProcessingPtr.get() == NULL)
668 virtual bool empty() const;
669
670 /// access to a spectrum index
671 virtual const SpectrumIdentity& spectrumIdentity(size_t index) const = 0;
672
673 /// find id in the spectrum index (returns size() on failure)
674 virtual size_t find(const std::string& id) const;
675
676 /// find an abbreviated id (e.g. "1.1.123.2" for "sample=1 period=1 cycle=123 experiment=2") in the spectrum index (returns size() on failure)
677 virtual size_t findAbbreviated(const std::string& abbreviatedId, char delimiter = '.') const;
678
679 /// find all spectrum indexes with specified name/value pair
680 virtual IndexList findNameValue(const std::string& name, const std::string& value) const;
681
682 /// find all spectrum indexes with spotID (returns empty vector on failure)
683 virtual IndexList findSpotID(const std::string& spotID) const;
684
685 /// retrieve a spectrum by index
686 /// - binary data arrays will be provided if (getBinaryData == true);
687 /// - client may assume the underlying Spectrum* is valid
688 virtual SpectrumPtr spectrum(size_t index, bool getBinaryData = false) const = 0;
689
690 /// get a copy of the seed spectrum, optionally with its binary data populated
691 /// this is useful for formats like mzML that can delay loading of binary data
692 /// - client may assume the underlying Spectrum* is valid
693 virtual SpectrumPtr spectrum(const SpectrumPtr& seed, bool getBinaryData) const;
694
695 /// retrieve a spectrum by index
696 /// - detailLevel determines what fields are guaranteed present on the spectrum after the call
697 /// - client may assume the underlying Spectrum* is valid
698 virtual SpectrumPtr spectrum(size_t index, DetailLevel detailLevel) const;
699
700 /// returns the data processing affecting spectra retrieved through this interface
701 /// - may return a null shared pointer
702 virtual const boost::shared_ptr<const DataProcessing> dataProcessingPtr() const;
703
704 /// issues a warning once per SpectrumList instance (based on string hash)
705 virtual void warn_once(const char* msg) const;
706
707 virtual ~SpectrumList(){}
708};
709
710
711typedef boost::shared_ptr<SpectrumList> SpectrumListPtr;
712
713
714/// Simple writeable in-memory implementation of SpectrumList.
715/// Note: This spectrum() implementation returns internal SpectrumPtrs.
717{
718 std::vector<SpectrumPtr> spectra;
720
721 // SpectrumList implementation
722
723 virtual size_t size() const {return spectra.size();}
724 virtual bool empty() const {return spectra.empty() && !dp.get();}
725 virtual const SpectrumIdentity& spectrumIdentity(size_t index) const;
726 virtual SpectrumPtr spectrum(size_t index, bool getBinaryData) const;
727 virtual const boost::shared_ptr<const DataProcessing> dataProcessingPtr() const;
728};
729
730
731typedef boost::shared_ptr<SpectrumListSimple> SpectrumListSimplePtr;
732
733
734///
735/// Interface for accessing chromatograms, which may be stored in memory
736/// or backed by a data file (RAW, mzXML, mzML).
737///
738/// Implementation notes:
739///
740/// - Implementations are expected to keep a chromatogram index in the form of
741/// vector<ChromatogramIdentity> or equivalent. The default find*() functions search
742/// the index linearly. Implementations may provide constant time indexing.
743///
744/// - The semantics of chromatogram() may vary slightly with implementation. In particular,
745/// a ChromatogramList implementation that is backed by a file may choose either to cache
746/// or discard the ChromatogramPtrs for future access, with the caveat that the client
747/// may write to the underlying data.
748///
749/// - It is the implementation's responsibility to return a valid ChromatogramPtr from chromatogram().
750/// If this cannot be done, an exception must be thrown.
751///
752/// - The 'getBinaryData' flag is a hint if false : implementations may provide valid
753/// BinaryDataArrayPtrs on chromatogram(index, false); implementations *must* provide
754/// valid BinaryDataArrayPtrs on chromatogram(index, true).
755///
757{
758 public:
759
760 /// returns the number of chromatograms
761 virtual size_t size() const = 0;
762
763 /// returns true iff (size() == 0) and (dataProcessingPtr.get() == NULL)
764 bool empty() const;
765
766 /// access to a chromatogram index
767 virtual const ChromatogramIdentity& chromatogramIdentity(size_t index) const = 0;
768
769 /// find id in the chromatogram index (returns size() on failure)
770 virtual size_t find(const std::string& id) const;
771
772 /// retrieve a chromatogram by index
773 /// - binary data arrays will be provided if (getBinaryData == true);
774 /// - client may assume the underlying Chromatogram* is valid
775 virtual ChromatogramPtr chromatogram(size_t index, bool getBinaryData = false) const = 0;
776
777 /// returns the data processing affecting spectra retrieved through this interface
778 /// - may return a null shared pointer
779 virtual const boost::shared_ptr<const DataProcessing> dataProcessingPtr() const;
780
781 virtual ~ChromatogramList(){}
782};
783
784
785typedef boost::shared_ptr<ChromatogramList> ChromatogramListPtr;
786
787
788/// Simple writeable in-memory implementation of ChromatogramList.
789/// Note: This chromatogram() implementation returns internal ChromatogramPtrs.
791{
792 std::vector<ChromatogramPtr> chromatograms;
794
795 // ChromatogramList implementation
796
797 virtual size_t size() const {return chromatograms.size();}
798 virtual bool empty() const {return chromatograms.empty() && !dp.get();}
799 virtual const ChromatogramIdentity& chromatogramIdentity(size_t index) const;
800 virtual ChromatogramPtr chromatogram(size_t index, bool getBinaryData) const;
801 virtual const boost::shared_ptr<const DataProcessing> dataProcessingPtr() const;
802};
803
804
805typedef boost::shared_ptr<ChromatogramListSimple> ChromatogramListSimplePtr;
806
807
808/// A run in mzML should correspond to a single, consecutive and coherent set of scans on an instrument.
810{
811 /// a unique identifier for this run.
812 std::string id;
813
814 /// this attribute MUST reference the 'id' of the default instrument configuration. If a scan does not reference an instrument configuration, it implicitly refers to this configuration.
816
817 /// this attribute MUST reference the 'id' of the appropriate sample.
819
820 /// the optional start timestamp of the run, in UT.
821 std::string startTimeStamp;
822
823 /// default source file reference
825
826 /// all mass spectra and the acquisitions underlying them are described and attached here. Subsidiary data arrays are also both described and attached here.
828
829 /// all chromatograms for this run.
831
832 Run(){}
833 bool empty() const;
834
835 private:
836 // no copying - any implementation must handle:
837 // - SpectrumList cloning
838 // - internal cross-references to heap-allocated objects
839 Run(const Run&);
840 Run& operator=(const Run&);
841};
842
843
844namespace IO {struct HandlerMSData;} // forward declaration for friend
845
846
847/// This is the root element of ProteoWizard; it represents the mzML element, defined as:
848/// intended to capture the use of a mass spectrometer, the data generated, and the initial processing of that data (to the level of the peak list).
850{
851 /// an optional accession number for the mzML document.
852 std::string accession;
853
854 /// an optional id for the mzML document. It is recommended to use LSIDs when possible.
855 std::string id;
856
857 /// container for one or more controlled vocabulary definitions.
858 /// note: one of the <cv> elements in this list MUST be the PSI MS controlled vocabulary. All <cvParam> elements in the document MUST refer to one of the <cv> elements in this list.
859 std::vector<CV> cvs;
860
861 /// information pertaining to the entire mzML file (i.e. not specific to any part of the data set) is stored here.
863
864 /// container for a list of referenceableParamGroups
865 std::vector<ParamGroupPtr> paramGroupPtrs;
866
867 /// list and descriptions of samples.
868 std::vector<SamplePtr> samplePtrs;
869
870 /// list and descriptions of software used to acquire and/or process the data in this mzML file.
871 std::vector<SoftwarePtr> softwarePtrs;
872
873 /// list with the descriptions of the acquisition settings applied prior to the start of data acquisition.
874 std::vector<ScanSettingsPtr> scanSettingsPtrs;
875
876 /// list and descriptions of instrument configurations.
877 std::vector<InstrumentConfigurationPtr> instrumentConfigurationPtrs;
878
879 /// list and descriptions of data processing applied to this data.
880 std::vector<DataProcessingPtr> dataProcessingPtrs;
881
882 /// return dataProcessingPtrs augmented by the dataProcessingPtr() set in SpectrumList and/or ChromatogramList
883 std::vector<DataProcessingPtr> allDataProcessingPtrs() const;
884
885 /// a run in mzML should correspond to a single, consecutive and coherent set of scans on an instrument.
887
889 virtual ~MSData();
890 bool empty() const;
891
892 /// returns the version of this mzML document;
893 /// for a document created programmatically, the version is the current release version of mzML;
894 /// for a document created from a file/stream, the version is the schema version read from the file/stream
895 const std::string& version() const;
896
897 // for detecting out of order filters
898 void filterApplied() {nFiltersApplied_++;};
899 int countFiltersApplied() const {return nFiltersApplied_;};
900
901 private:
902 // no copying
903 MSData(const MSData&);
905
906 protected:
907 std::string version_; // schema version read from the file/stream
908 friend struct IO::HandlerMSData;
909 int nFiltersApplied_; // useful for flagging filters that need to be first, like vendor centroiding
910};
911
912
913typedef boost::shared_ptr<MSData> MSDataPtr;
914
915
916namespace id {
917
918/// parses an id string into a map<string,string>
919PWIZ_API_DECL std::map<std::string,std::string> parse(const std::string& id);
920
921/// convenience function to extract a named value from an id string
922PWIZ_API_DECL std::string value(const std::string& id, const std::string& name);
923
924/// templated convenience function to extract a named value from an id string
925template<typename value_type>
926value_type valueAs(const std::string& id, const std::string& name)
927{
928 std::string result = value(id, name);
929 return !result.empty() ? boost::lexical_cast<value_type>(result)
930 : boost::lexical_cast<value_type>(0);
931}
932
933/// returns the nativeID format from the defaultSourceFilePtr if set,
934/// or from sourceFilePtrs[0] if the list isn't empty,
935/// or CVID_Unknown
937
938/// translates a "scan number" to a string that is correct for the given nativeID format;
939/// semantic validity requires that scanNumber be parseable as an integer;
940/// some nativeID formats cannot be translated to and will always return an empty string
941/// currently supported formats: Thermo, Bruker/Agilent YEP, Bruker BAF, mzXML, MGF, and mzData
942PWIZ_API_DECL std::string translateScanNumberToNativeID(CVID nativeIDFormat, const std::string& scanNumber);
943
944/// translates a nativeID in the given nativeID format to a simple integer "scan number";
945/// some nativeID formats cannot be translated from and will always return an empty string
946/// currently supported formats: Thermo, Bruker/Agilent YEP, Bruker BAF, mzXML, MGF, and mzData
947PWIZ_API_DECL std::string translateNativeIDToScanNumber(CVID nativeIDFormat, const std::string& id);
948
949/// abbreviates a nativeID ("name1=value1 name2=value2" translates to "value1.value2")
950PWIZ_API_DECL std::string abbreviate(const std::string& id, char delimiter = '.');
951
952} // namespace id
953
954
955} // namespace msdata
956} // namespace pwiz
957
958
959#endif // _MSDATA_HPP_
960
#define PWIZ_API_DECL
Definition Export.hpp:32
Interface for accessing chromatograms, which may be stored in memory or backed by a data file (RAW,...
Definition MSData.hpp:757
virtual size_t size() const =0
returns the number of chromatograms
virtual ChromatogramPtr chromatogram(size_t index, bool getBinaryData=false) const =0
retrieve a chromatogram by index
virtual size_t find(const std::string &id) const
find id in the chromatogram index (returns size() on failure)
virtual const ChromatogramIdentity & chromatogramIdentity(size_t index) const =0
access to a chromatogram index
bool empty() const
returns true iff (size() == 0) and (dataProcessingPtr.get() == NULL)
virtual const boost::shared_ptr< const DataProcessing > dataProcessingPtr() const
returns the data processing affecting spectra retrieved through this interface
Interface for accessing spectra, which may be stored in memory or backed by a data file (RAW,...
Definition MSData.hpp:661
virtual SpectrumPtr spectrum(const SpectrumPtr &seed, bool getBinaryData) const
get a copy of the seed spectrum, optionally with its binary data populated this is useful for formats...
virtual const boost::shared_ptr< const DataProcessing > dataProcessingPtr() const
returns the data processing affecting spectra retrieved through this interface
virtual void warn_once(const char *msg) const
issues a warning once per SpectrumList instance (based on string hash)
virtual IndexList findNameValue(const std::string &name, const std::string &value) const
find all spectrum indexes with specified name/value pair
virtual IndexList findSpotID(const std::string &spotID) const
find all spectrum indexes with spotID (returns empty vector on failure)
virtual size_t findAbbreviated(const std::string &abbreviatedId, char delimiter='.') const
find an abbreviated id (e.g. "1.1.123.2" for "sample=1 period=1 cycle=123 experiment=2") in the spect...
virtual size_t size() const =0
returns the number of spectra
virtual SpectrumPtr spectrum(size_t index, bool getBinaryData=false) const =0
retrieve a spectrum by index
virtual size_t find(const std::string &id) const
find id in the spectrum index (returns size() on failure)
virtual bool empty() const
returns true iff (size() == 0) and (dataProcessingPtr.get() == NULL)
virtual SpectrumPtr spectrum(size_t index, DetailLevel detailLevel) const
retrieve a spectrum by index
virtual const SpectrumIdentity & spectrumIdentity(size_t index) const =0
access to a spectrum index
A custom vector class that can store its contents in either a std::vector or a cli::array (when compi...
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 std::string translateScanNumberToNativeID(CVID nativeIDFormat, const std::string &scanNumber)
translates a "scan number" to a string that is correct for the given nativeID format; semantic validi...
PWIZ_API_DECL std::map< std::string, std::string > parse(const std::string &id)
parses an id string into a map<string,string>
PWIZ_API_DECL std::string abbreviate(const std::string &id, char delimiter='.')
abbreviates a nativeID ("name1=value1 name2=value2" translates to "value1.value2")
PWIZ_API_DECL std::string value(const std::string &id, const std::string &name)
convenience function to extract a named value from an id string
PWIZ_API_DECL CVID getDefaultNativeIDFormat(const MSData &msd)
returns the nativeID format from the defaultSourceFilePtr if set, or from sourceFilePtrs[0] if the li...
value_type valueAs(const std::string &id, const std::string &name)
templated convenience function to extract a named value from an id string
Definition MSData.hpp:926
PWIZ_API_DECL std::string translateNativeIDToScanNumber(CVID nativeIDFormat, const std::string &id)
translates a nativeID in the given nativeID format to a simple integer "scan number"; some nativeID f...
@ ComponentType_Analyzer
Definition MSData.hpp:125
@ ComponentType_Detector
Definition MSData.hpp:126
@ ComponentType_Source
Definition MSData.hpp:124
@ ComponentType_Unknown
Definition MSData.hpp:123
boost::shared_ptr< DataProcessing > DataProcessingPtr
Definition MSData.hpp:288
boost::shared_ptr< Software > SoftwarePtr
Definition MSData.hpp:198
boost::shared_ptr< SpectrumList > SpectrumListPtr
Definition MSData.hpp:711
boost::shared_ptr< ScanSettings > ScanSettingsPtr
Definition MSData.hpp:225
boost::shared_ptr< Sample > SamplePtr
Definition MSData.hpp:118
boost::shared_ptr< Chromatogram > ChromatogramPtr
Definition MSData.hpp:624
boost::shared_ptr< MSData > MSDataPtr
Definition MSData.hpp:913
boost::shared_ptr< BinaryDataArray > BinaryDataArrayPtr
Definition MSData.hpp:417
boost::shared_ptr< Spectrum > SpectrumPtr
Definition MSData.hpp:573
boost::shared_ptr< InstrumentConfiguration > InstrumentConfigurationPtr
Definition MSData.hpp:250
boost::shared_ptr< SpectrumListSimple > SpectrumListSimplePtr
Definition MSData.hpp:731
boost::shared_ptr< ChromatogramListSimple > ChromatogramListSimplePtr
Definition MSData.hpp:805
boost::shared_ptr< ChromatogramList > ChromatogramListPtr
Definition MSData.hpp:785
PWIZ_API_DECL std::vector< CV > defaultCVList()
boost::shared_ptr< SourceFile > SourceFilePtr
Description of the source file, including location and type.
Definition MSData.hpp:76
const size_t IDENTITY_INDEX_NONE
Definition MSData.hpp:467
boost::shared_ptr< ProcessingMethod > ProcessingMethodPtr
Definition MSData.hpp:269
@ DetailLevel_FullData
Definition MSData.hpp:635
@ DetailLevel_FastMetadata
Definition MSData.hpp:633
@ DetailLevel_FullMetadata
Definition MSData.hpp:634
@ DetailLevel_InstantMetadata
Definition MSData.hpp:632
represents a tag-value pair, where the tag comes from the controlled vocabulary
The base class for elements that may contain cvParams, userParams, or paramGroup references.
The type and energy level used for activation.
Definition MSData.hpp:307
The structure into which encoded binary data goes. Byte ordering is always little endian (Intel style...
Definition MSData.hpp:405
bool empty() const
returns true iff the element contains no params and all members are empty or null
DataProcessingPtr dataProcessingPtr
this optional attribute may reference the 'id' attribute of the appropriate dataProcessing.
Definition MSData.hpp:407
pwiz::util::BinaryData< double > data
the binary data.
Definition MSData.hpp:410
A single chromatogram.
Definition MSData.hpp:578
void getTimeIntensityPairs(std::vector< TimeIntensityPair > &output) const
copy binary data arrays into time-intensity pair array
BinaryDataArrayPtr getIntensityArray() const
get intensity array (may be null)
BinaryDataArrayPtr getTimeArray() const
get time array (may be null)
DataProcessingPtr dataProcessingPtr
this attribute can optionally reference the 'id' of the appropriate dataProcessing.
Definition MSData.hpp:583
void setTimeIntensityPairs(const std::vector< TimeIntensityPair > &input, CVID timeUnits, CVID intensityUnits)
set binary data arrays
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
Definition MSData.hpp:592
Precursor precursor
description of precursor ion information (i.e. Q1 settings)
Definition MSData.hpp:586
size_t defaultArrayLength
default length of binary data arrays contained in this element.
Definition MSData.hpp:580
void setTimeIntensityArrays(const std::vector< double > &timeArray, const std::vector< double > &intensityArray, CVID timeUnits, CVID intensityUnits)
set time and intensity arrays separately (they must be the same size)
void setTimeIntensityPairs(const TimeIntensityPair *input, size_t size, CVID timeUnits, CVID intensityUnits)
set binary data arrays
Product product
description of product ion information (i.e. Q3 settings)
Definition MSData.hpp:589
bool empty() const
returns true iff the element contains no params and all members are empty or null
void getTimeIntensityPairs(TimeIntensityPair *output, size_t expectedSize) const
copy binary data arrays into time-intensity pair array note: this overload is to allow client to allo...
Identifying information for a chromatogram.
Definition MSData.hpp:490
std::string id
a unique identifier for this chromatogram. It should be expected that external files may use this ide...
Definition MSData.hpp:495
size_t index
the zero-based, consecutive index of the chromatogram in the ChromatogramList.
Definition MSData.hpp:492
boost::iostreams::stream_offset sourceFilePosition
for file-based MSData implementations, this attribute may refer to the chromatogram's position in the...
Definition MSData.hpp:498
Simple writeable in-memory implementation of ChromatogramList.
Definition MSData.hpp:791
virtual ChromatogramPtr chromatogram(size_t index, bool getBinaryData) const
retrieve a chromatogram by index
virtual const ChromatogramIdentity & chromatogramIdentity(size_t index) const
access to a chromatogram index
std::vector< ChromatogramPtr > chromatograms
Definition MSData.hpp:792
virtual const boost::shared_ptr< const DataProcessing > dataProcessingPtr() const
returns the data processing affecting spectra retrieved through this interface
virtual size_t size() const
returns the number of chromatograms
Definition MSData.hpp:797
A component of an instrument corresponding to a source (i.e. ion source), an analyzer (i....
Definition MSData.hpp:132
Component(CVID cvid, int order)
Definition MSData.hpp:141
ComponentType type
the type of component (Source, Analyzer, or Detector)
Definition MSData.hpp:134
Component(ComponentType type, int order)
Definition MSData.hpp:140
bool empty() const
returns true iff the element contains no params and all members are empty or null
int order
this attribute MUST be used to indicate the order in which the components are encountered from source...
Definition MSData.hpp:137
void define(CVID cvid, int order)
List with the different components used in the mass spectrometer. At least one source,...
Definition MSData.hpp:157
Component & detector(size_t index)
returns the detector component with ordinal <index+1>
const Component & analyzer(size_t index) const
returns the analyzer component with ordinal <index+1>
const Component & detector(size_t index) const
returns the detector component with ordinal <index+1>
const Component & source(size_t index) const
returns the source component with ordinal <index+1>
Component & source(size_t index)
returns the source component with ordinal <index+1>
Component & analyzer(size_t index)
returns the analyzer component with ordinal <index+1>
Structure allowing the use of a controlled (cvParam) or uncontrolled vocabulary (userParam),...
Definition MSData.hpp:80
Description of the way in which a particular software was used.
Definition MSData.hpp:274
DataProcessing(const std::string &_id="")
std::vector< ProcessingMethod > processingMethods
description of the default peak processing method(s). This element describes the base method used in ...
Definition MSData.hpp:279
bool empty() const
returns true iff the element contains no params and all members are empty or null
std::string id
a unique identifier for this data processing that is unique across all DataProcessingTypes.
Definition MSData.hpp:276
This summarizes the different types of spectra that can be expected in the file. This is expected to ...
Definition MSData.hpp:50
Information pertaining to the entire mzML file (i.e. not specific to any part of the data set) is sto...
Definition MSData.hpp:85
std::vector< Contact > contacts
structure allowing the use of a controlled (cvParam) or uncontrolled vocabulary (userParam),...
Definition MSData.hpp:93
FileContent fileContent
this summarizes the different types of spectra that can be expected in the file. This is expected to ...
Definition MSData.hpp:87
bool empty() const
returns true iff all members are empty or null
std::vector< SourceFilePtr > sourceFilePtrs
list and descriptions of the source files this mzML document was generated or derived from.
Definition MSData.hpp:90
Description of a particular hardware configuration of a mass spectrometer. Each configuration MUST ha...
Definition MSData.hpp:230
ComponentList componentList
list with the different components used in the mass spectrometer. At least one source,...
Definition MSData.hpp:235
bool empty() const
returns true iff the element contains no params and all members are empty or null
std::string id
an identifier for this instrument configuration.
Definition MSData.hpp:232
InstrumentConfiguration(const std::string &_id="")
SoftwarePtr softwarePtr
reference to a previously defined software element.
Definition MSData.hpp:238
ScanSettingsPtr scanSettingsPtr
reference to a scan settings element defining global scan settings used by this configuration
Definition MSData.hpp:241
This element captures the isolation (or 'selection') window configured to isolate one or more precurs...
Definition MSData.hpp:292
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition MSData.hpp:850
std::vector< ScanSettingsPtr > scanSettingsPtrs
list with the descriptions of the acquisition settings applied prior to the start of data acquisition...
Definition MSData.hpp:874
const std::string & version() const
returns the version of this mzML document; for a document created programmatically,...
Run run
a run in mzML should correspond to a single, consecutive and coherent set of scans on an instrument.
Definition MSData.hpp:886
bool empty() const
int countFiltersApplied() const
Definition MSData.hpp:899
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
std::string accession
an optional accession number for the mzML document.
Definition MSData.hpp:852
MSData & operator=(const MSData &)
std::string version_
Definition MSData.hpp:907
std::string id
an optional id for the mzML document. It is recommended to use LSIDs when possible.
Definition MSData.hpp:855
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
std::vector< InstrumentConfigurationPtr > instrumentConfigurationPtrs
list and descriptions of instrument configurations.
Definition MSData.hpp:877
std::vector< ParamGroupPtr > paramGroupPtrs
container for a list of referenceableParamGroups
Definition MSData.hpp:865
MSData(const MSData &)
std::vector< DataProcessingPtr > allDataProcessingPtrs() const
return dataProcessingPtrs augmented by the dataProcessingPtr() set in SpectrumList and/or Chromatogra...
std::vector< SamplePtr > samplePtrs
list and descriptions of samples.
Definition MSData.hpp:868
std::vector< DataProcessingPtr > dataProcessingPtrs
list and descriptions of data processing applied to this data.
Definition MSData.hpp:880
std::vector< CV > cvs
container for one or more controlled vocabulary definitions.
Definition MSData.hpp:859
The data point type of a mass spectrum.
Definition MSData.hpp:423
MZIntensityPair(double mz, double intensity)
Definition MSData.hpp:431
bool operator==(const MZIntensityPair &that) const
returns true iff mz and intensity are pairwise equal
The method of precursor ion selection and activation.
Definition MSData.hpp:312
bool empty() const
returns true iff the element contains no params and all members are empty or null
SourceFilePtr sourceFilePtr
for precursor spectra that are external to this document, this attribute MUST reference the 'id' attr...
Definition MSData.hpp:315
std::vector< SelectedIon > selectedIons
this list of precursor ions that were selected.
Definition MSData.hpp:329
IsolationWindow isolationWindow
this element captures the isolation (or 'selection') window configured to isolate one or more precurs...
Definition MSData.hpp:326
Activation activation
the type and energy level used for activation.
Definition MSData.hpp:332
std::string spectrumID
reference to the id attribute of the spectrum from which the precursor was selected.
Definition MSData.hpp:323
Precursor(double mz, int chargeState)
Precursor(double mz, double intensity, CVID intensityUnit)
std::string externalSpectrumID
for precursor spectra that are external to this document, this string MUST correspond to the 'id' att...
Definition MSData.hpp:319
Precursor(double mz, double intensity, int chargeState, CVID intensityUnit)
Description of the default peak processing method. This element describes the base method used in the...
Definition MSData.hpp:255
int order
this attributes allows a series of consecutive steps to be placed in the correct order.
Definition MSData.hpp:257
bool empty() const
returns true iff the element contains no params and all members are empty or null
SoftwarePtr softwarePtr
this attribute MUST reference the 'id' of the appropriate SoftwareType.
Definition MSData.hpp:260
product ion information
Definition MSData.hpp:348
bool empty() const
returns true iff the element contains no params and all members are empty or null
IsolationWindow isolationWindow
this element captures the isolation (or 'selection') window configured to isolate one or more precurs...
Definition MSData.hpp:350
bool operator==(const Product &that) const
returns true iff this product's isolation window is equal to that product's
A run in mzML should correspond to a single, consecutive and coherent set of scans on an instrument.
Definition MSData.hpp:810
Run & operator=(const Run &)
SourceFilePtr defaultSourceFilePtr
default source file reference
Definition MSData.hpp:824
std::string id
a unique identifier for this run.
Definition MSData.hpp:812
std::string startTimeStamp
the optional start timestamp of the run, in UT.
Definition MSData.hpp:821
InstrumentConfigurationPtr defaultInstrumentConfigurationPtr
this attribute MUST reference the 'id' of the default instrument configuration. If a scan does not re...
Definition MSData.hpp:815
SamplePtr samplePtr
this attribute MUST reference the 'id' of the appropriate sample.
Definition MSData.hpp:818
ChromatogramListPtr chromatogramListPtr
all chromatograms for this run.
Definition MSData.hpp:830
SpectrumListPtr spectrumListPtr
all mass spectra and the acquisitions underlying them are described and attached here....
Definition MSData.hpp:827
bool empty() const
Run(const Run &)
Expansible description of the sample used to generate the dataset, named in sampleName.
Definition MSData.hpp:102
std::string name
an optional name for the sample description, mostly intended as a quick mnemonic.
Definition MSData.hpp:107
std::string id
a unique identifier across the samples with which to reference this sample description.
Definition MSData.hpp:104
Sample(const std::string _id="", const std::string _name="")
bool empty() const
returns true iff the element contains no params and all members are empty or null
Scan or acquisition from original raw file used to create this peak list, as specified in sourceFile.
Definition MSData.hpp:370
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
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
InstrumentConfigurationPtr instrumentConfigurationPtr
this attribute MUST reference the 'id' attribute of the appropriate instrument configuration.
Definition MSData.hpp:384
bool empty() const
returns true iff the element contains no params and all members are empty or null
SourceFilePtr sourceFilePtr
if this attribute is set, it must reference the 'id' attribute of a sourceFile representing the exter...
Definition MSData.hpp:373
std::vector< ScanWindow > scanWindows
container for a list of select windows.
Definition MSData.hpp:387
List and descriptions of scans.
Definition MSData.hpp:396
std::vector< Scan > scans
Definition MSData.hpp:397
Description of the acquisition settings of the instrument prior to the start of the run.
Definition MSData.hpp:207
std::vector< Target > targets
target list (or 'inclusion list') configured prior to the run.
Definition MSData.hpp:215
std::string id
a unique identifier for this acquisition setting.
Definition MSData.hpp:209
ScanSettings(const std::string &_id="")
bool empty() const
returns true iff the element contains no params and all members are empty or null
std::vector< SourceFilePtr > sourceFilePtrs
container for a list of source file references.
Definition MSData.hpp:212
ScanWindow(double low, double high, CVID unit)
SelectedIon(double mz, double intensity, CVID intensityUnit)
SelectedIon(double mz, double intensity, int chargeState, CVID intensityUnit)
SelectedIon(double mz, int chargeState)
A piece of software.
Definition MSData.hpp:180
Software(const std::string &_id, const CVParam &_param, const std::string &_version)
std::string id
an identifier for this software that is unique across all SoftwareTypes.
Definition MSData.hpp:182
std::string version
the software version.
Definition MSData.hpp:185
bool empty() const
returns true iff all members are empty or null
Software(const std::string &_id="")
Description of the source file, including location and type.
Definition MSData.hpp:55
std::string name
name of the source file, without reference to location (either URI or local path).
Definition MSData.hpp:60
SourceFile(const std::string _id="", const std::string _name="", const std::string _location="")
bool empty() const
returns true iff the element contains no params and all members are empty or null
std::string location
URI-formatted location where the file was retrieved.
Definition MSData.hpp:63
std::string id
an identifier for this file.
Definition MSData.hpp:57
The structure that captures the generation of a peak list (including the underlying acquisitions)
Definition MSData.hpp:506
void getMZIntensityPairs(MZIntensityPair *output, size_t expectedSize) const
copy binary data arrays into m/z-intensity pair array note: this overload is to allow client to alloc...
SourceFilePtr sourceFilePtr
this attribute can optionally reference the 'id' of the appropriate sourceFile.
Definition MSData.hpp:514
std::vector< Product > products
list and descriptions of product ion information
Definition MSData.hpp:523
void setMZIntensityArrays(const std::vector< double > &mzArray, const std::vector< double > &intensityArray, CVID intensityUnits)
set m/z and intensity arrays separately (they must be the same size)
void swapMZIntensityArrays(pwiz::util::BinaryData< double > &mzArray, pwiz::util::BinaryData< double > &intensityArray, CVID intensityUnits)
set m/z and intensity arrays separately (they must be the same size) by swapping the vector contents ...
DataProcessingPtr dataProcessingPtr
this attribute can optionally reference the 'id' of the appropriate dataProcessing.
Definition MSData.hpp:511
BinaryDataArrayPtr getIntensityArray() const
get intensity array (may be null)
bool hasBinaryData() const
returns true iff has nonnull and nonempty BinaryDataArrayPtr
Definition MSData.hpp:535
void setMZIntensityPairs(const std::vector< MZIntensityPair > &input, CVID intensityUnits)
set binary data arrays
size_t defaultArrayLength
default length of binary data arrays contained in this element.
Definition MSData.hpp:508
BinaryDataArrayPtr getMZArray() const
get m/z array (may be null)
ScanList scanList
list of scans
Definition MSData.hpp:517
void getMZIntensityPairs(std::vector< MZIntensityPair > &output) const
copy binary data arrays into m/z-intensity pair array
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
Definition MSData.hpp:526
bool empty() const
returns true iff the element contains no params and all members are empty or null
void setMZIntensityPairs(const MZIntensityPair *input, size_t size, CVID intensityUnits)
set binary data arrays
BinaryDataArrayPtr getArrayByCVID(CVID arrayType) const
get array with specified CVParam (may be null)
std::vector< Precursor > precursors
list and descriptions of precursors to the spectrum currently being described.
Definition MSData.hpp:520
Identifying information for a spectrum.
Definition MSData.hpp:471
boost::iostreams::stream_offset sourceFilePosition
for file-based MSData implementations, this attribute may refer to the spectrum's position in the fil...
Definition MSData.hpp:482
std::string id
a unique identifier for this spectrum. It should be expected that external files may use this identif...
Definition MSData.hpp:476
std::string spotID
the identifier for the spot from which this spectrum was derived, if a MALDI or similar run.
Definition MSData.hpp:479
size_t index
the zero-based, consecutive index of the spectrum in the SpectrumList.
Definition MSData.hpp:473
Simple writeable in-memory implementation of SpectrumList.
Definition MSData.hpp:717
virtual SpectrumPtr spectrum(size_t index, bool getBinaryData) const
retrieve a spectrum by index
virtual size_t size() const
returns the number of spectra
Definition MSData.hpp:723
virtual bool empty() const
returns true iff (size() == 0) and (dataProcessingPtr.get() == NULL)
Definition MSData.hpp:724
virtual const boost::shared_ptr< const DataProcessing > dataProcessingPtr() const
returns the data processing affecting spectra retrieved through this interface
virtual const SpectrumIdentity & spectrumIdentity(size_t index) const
access to a spectrum index
std::vector< SpectrumPtr > spectra
Definition MSData.hpp:718
The data point type of a chromatogram.
Definition MSData.hpp:447
bool operator==(const TimeIntensityPair &that) const
returns true iff time and intensity are pairwise equal
TimeIntensityPair(double time, double intensity)
Definition MSData.hpp:455