ProteoWizard
SpectrumList_FilterTest.cpp
Go to the documentation of this file.
1 //
2 // $Id: SpectrumList_FilterTest.cpp 6478 2014-07-08 20:01:38Z chambm $
3 //
4 //
5 // Original author: Darren Kessner <darren@proteowizard.org>
6 //
7 // Copyright 2008 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 #include "SpectrumList_Filter.hpp"
30 #include <cstring>
31 
32 
33 using namespace pwiz;
34 using namespace pwiz::msdata;
35 using namespace pwiz::analysis;
36 using namespace pwiz::util;
37 using boost::logic::tribool;
38 
39 
40 ostream* os_ = 0;
41 
42 
43 void printSpectrumList(const SpectrumList& sl, ostream& os)
44 {
45  os << "size: " << sl.size() << endl;
46 
47  for (size_t i=0, end=sl.size(); i<end; i++)
48  {
49  SpectrumPtr spectrum = sl.spectrum(i, false);
50  os << spectrum->index << " "
51  << spectrum->id << " "
52  << "ms" << spectrum->cvParam(MS_ms_level).value << " "
53  << "scanEvent:" << spectrum->scanList.scans[0].cvParam(MS_preset_scan_configuration).value << " "
54  << "scanTime:" << spectrum->scanList.scans[0].cvParam(MS_scan_start_time).timeInSeconds() << " "
55  << endl;
56  }
57 }
58 
59 
61 {
63 
64  for (size_t i=0; i<10; ++i)
65  {
66  SpectrumPtr spectrum(new Spectrum);
67  spectrum->index = i;
68  spectrum->id = "scan=" + lexical_cast<string>(100+i);
69  spectrum->setMZIntensityPairs(vector<MZIntensityPair>(i), MS_number_of_detector_counts);
70 
71  // add mz/intensity to the spectra for mzPresent filter
72  vector<MZIntensityPair> mzint(i*2);
73  for (size_t j=1.0; j<i*2; ++j)
74  {
75  mzint.insert(mzint.end(), MZIntensityPair(j*100, j*j));
76  }
77  spectrum->setMZIntensityPairs(mzint, MS_number_of_detector_counts);
78 
79  bool isMS1 = i%3==0;
80  spectrum->set(MS_ms_level, isMS1 ? 1 : 2);
81  spectrum->set(isMS1 ? MS_MS1_spectrum : MS_MSn_spectrum);
82 
83  // outfit the spectra with mass analyzer definitions to test the massAnalyzer filter
84  spectrum->scanList.scans.push_back(Scan());
85 
86  spectrum->scanList.scans[0].instrumentConfigurationPtr = InstrumentConfigurationPtr(new InstrumentConfiguration());
87  InstrumentConfigurationPtr p = spectrum->scanList.scans[0].instrumentConfigurationPtr;
88  if (i%3 == 0)
89  {
90  p->componentList.push_back(Component(MS_orbitrap, 0/*order*/));
91  }
92  else
93  {
94  if (i%2)
95  p->componentList.push_back(Component(MS_orbitrap, 0/*order*/));
96  else
97  p->componentList.push_back(Component(MS_radial_ejection_linear_ion_trap, 0/*order*/));
98  }
99 
100  if (i%3 != 0)
101  spectrum->precursors.push_back(Precursor(500, 3));
102 
103  // add precursors and activation types to the MS2 spectra
104  if (i==1 || i ==5) // ETD
105  {
106  spectrum->precursors[0].activation.set(MS_electron_transfer_dissociation);
107  }
108  else if (i==2) // CID
109  {
110  spectrum->precursors[0].activation.set(MS_collision_induced_dissociation);
111  }
112  else if (i==4) // HCD
113  {
114  spectrum->precursors[0].activation.set(MS_HCD);
115  }
116  else if (i==8) // IRMPD
117  {
118  spectrum->precursors[0].activation.set(MS_IRMPD);
119  }
120  else if (i==7) // ETD + SA
121  {
122  spectrum->precursors[0].activation.set(MS_electron_transfer_dissociation);
123  spectrum->precursors[0].activation.set(MS_collision_induced_dissociation);
124  }
125 
126  spectrum->scanList.scans.push_back(Scan());
127  spectrum->scanList.scans[0].set(MS_preset_scan_configuration, i%4);
128  spectrum->scanList.scans[0].set(MS_scan_start_time, 420+i, UO_second);
129  sl->spectra.push_back(spectrum);
130  }
131 
132  if (os_)
133  {
134  *os_ << "original spectrum list:\n";
135  printSpectrumList(*sl, *os_);
136  *os_ << endl;
137  }
138 
139  return sl;
140 }
141 
142 
144 {
145  virtual tribool accept(const SpectrumIdentity& spectrumIdentity) const
146  {
147  return spectrumIdentity.index%2 == 0;
148  }
149 };
150 
151 
153 {
154  if (os_) *os_ << "testEven:\n";
155 
157 
158  if (os_)
159  {
160  printSpectrumList(filter, *os_);
161  *os_ << endl;
162  }
163 
164  unit_assert(filter.size() == 5);
165 
166  for (size_t i=0, end=filter.size(); i<end; i++)
167  {
168  const SpectrumIdentity& id = filter.spectrumIdentity(i);
169  unit_assert(id.index == i);
170  unit_assert(id.id == "scan=" + lexical_cast<string>(100+i*2));
171 
172  SpectrumPtr spectrum = filter.spectrum(i);
173  unit_assert(spectrum->index == i);
174  unit_assert(spectrum->id == "scan=" + lexical_cast<string>(100+i*2));
175  }
176 }
177 
178 
180 {
181  virtual tribool accept(const SpectrumIdentity& spectrumIdentity) const
182  {
183  if (spectrumIdentity.index%2 != 0) return false;
184  return boost::logic::indeterminate;
185  }
186 
187  virtual tribool accept(const Spectrum& spectrum) const
188  {
189  CVParam param = spectrum.cvParamChild(MS_spectrum_type);
190  if (param.cvid == CVID_Unknown) return boost::logic::indeterminate;
191  if (!cvIsA(param.cvid, MS_mass_spectrum))
192  return true; // MS level filter doesn't affect non-MS spectra
193 
194  param = spectrum.cvParam(MS_ms_level);
195  if (param.cvid == CVID_Unknown) return boost::logic::indeterminate;
196 
197  return (param.valueAs<int>() == 2);
198  }
199 };
200 
201 
203 {
204  if (os_) *os_ << "testEvenMS2:\n";
205 
207 
208  if (os_)
209  {
210  printSpectrumList(filter, *os_);
211  *os_ << endl;
212  }
213 
214  unit_assert(filter.size() == 3);
215  unit_assert(filter.spectrumIdentity(0).id == "scan=102");
216  unit_assert(filter.spectrumIdentity(1).id == "scan=104");
217  unit_assert(filter.spectrumIdentity(2).id == "scan=108");
218 }
219 
220 
222 {
223  mutable bool pastMaxIndex;
224 
225  SelectedIndexPredicate() : pastMaxIndex(false) {}
226 
227  virtual tribool accept(const SpectrumIdentity& spectrumIdentity) const
228  {
229  if (spectrumIdentity.index>5) pastMaxIndex = true;
230 
231  return (spectrumIdentity.index==1 ||
232  spectrumIdentity.index==3 ||
233  spectrumIdentity.index==5);
234  }
235 
236  virtual bool done() const
237  {
238  return pastMaxIndex;
239  }
240 };
241 
242 
244 {
245  if (os_) *os_ << "testSelectedIndices:\n";
246 
248 
249  if (os_)
250  {
251  printSpectrumList(filter, *os_);
252  *os_ << endl;
253  }
254 
255  unit_assert(filter.size() == 3);
256  unit_assert(filter.spectrumIdentity(0).id == "scan=101");
257  unit_assert(filter.spectrumIdentity(1).id == "scan=103");
258  unit_assert(filter.spectrumIdentity(2).id == "scan=105");
259 }
260 
261 
263 {
264  HasBinaryDataPredicate(DetailLevel suggestedDetailLevel) : detailLevel_(suggestedDetailLevel) {}
265 
267  virtual DetailLevel suggestedDetailLevel() const {return detailLevel_;}
268 
269  virtual tribool accept(const msdata::SpectrumIdentity& spectrumIdentity) const
270  {
271  return boost::logic::indeterminate;
272  }
273 
274  virtual tribool accept(const Spectrum& spectrum) const
275  {
276  if (spectrum.binaryDataArrayPtrs.empty())
277  return boost::logic::indeterminate;
278  return !spectrum.binaryDataArrayPtrs[0]->data.empty();
279  }
280 };
281 
282 
284 {
285  if (os_) *os_ << "testHasBinaryData:\n";
286 
287  MSData msd;
289 
290  shared_ptr<stringstream> ss(new stringstream);
291  Serializer_mzML serializer;
292  serializer.write(*ss, msd);
293 
294  MSData msd2;
295  serializer.read(ss, msd2);
296 
297  sl = msd2.run.spectrumListPtr;
298 
299  {
301  unit_assert(filter.empty());
302  }
303 
304  {
306 
307  if (os_)
308  {
309  printSpectrumList(filter, *os_);
310  *os_ << endl;
311  }
312 
313  unit_assert_operator_equal(4, filter.size());
314  }
315 }
316 
317 
319 {
320  if (os_) *os_ << "testIndexSet:\n";
321 
322  IntegerSet indexSet;
323  indexSet.insert(3,5);
324  indexSet.insert(7);
325  indexSet.insert(9);
326 
328 
329  if (os_)
330  {
331  printSpectrumList(filter, *os_);
332  *os_ << endl;
333  }
334 
335  unit_assert(filter.size() == 5);
336  unit_assert(filter.spectrumIdentity(0).id == "scan=103");
337  unit_assert(filter.spectrumIdentity(1).id == "scan=104");
338  unit_assert(filter.spectrumIdentity(2).id == "scan=105");
339  unit_assert(filter.spectrumIdentity(3).id == "scan=107");
340  unit_assert(filter.spectrumIdentity(4).id == "scan=109");
341 }
342 
343 
345 {
346  if (os_) *os_ << "testScanNumberSet:\n";
347 
348  IntegerSet scanNumberSet;
349  scanNumberSet.insert(102,104);
350  scanNumberSet.insert(107);
351 
353 
354  if (os_)
355  {
356  printSpectrumList(filter, *os_);
357  *os_ << endl;
358  }
359 
360  unit_assert(filter.size() == 4);
361  unit_assert(filter.spectrumIdentity(0).id == "scan=102");
362  unit_assert(filter.spectrumIdentity(1).id == "scan=103");
363  unit_assert(filter.spectrumIdentity(2).id == "scan=104");
364  unit_assert(filter.spectrumIdentity(3).id == "scan=107");
365 }
366 
367 
369 {
370  if (os_) *os_ << "testScanEventSet:\n";
371 
372  IntegerSet scanEventSet;
373  scanEventSet.insert(0,0);
374  scanEventSet.insert(2,3);
375 
377 
378  if (os_)
379  {
380  printSpectrumList(filter, *os_);
381  *os_ << endl;
382  }
383 
384  unit_assert(filter.size() == 7);
385  unit_assert(filter.spectrumIdentity(0).id == "scan=100");
386  unit_assert(filter.spectrumIdentity(1).id == "scan=102");
387  unit_assert(filter.spectrumIdentity(2).id == "scan=103");
388  unit_assert(filter.spectrumIdentity(3).id == "scan=104");
389  unit_assert(filter.spectrumIdentity(4).id == "scan=106");
390  unit_assert(filter.spectrumIdentity(5).id == "scan=107");
391  unit_assert(filter.spectrumIdentity(6).id == "scan=108");
392 }
393 
394 
396 {
397  if (os_) *os_ << "testScanTimeRange:\n";
398 
399  const double low = 422.5;
400  const double high = 427.5;
401 
403 
404  if (os_)
405  {
406  printSpectrumList(filter, *os_);
407  *os_ << endl;
408  }
409 
410  unit_assert(filter.size() == 5);
411  unit_assert(filter.spectrumIdentity(0).id == "scan=103");
412  unit_assert(filter.spectrumIdentity(1).id == "scan=104");
413  unit_assert(filter.spectrumIdentity(2).id == "scan=105");
414  unit_assert(filter.spectrumIdentity(3).id == "scan=106");
415  unit_assert(filter.spectrumIdentity(4).id == "scan=107");
416 }
417 
418 
420 {
421  if (os_) *os_ << "testMSLevelSet:\n";
422 
423  IntegerSet msLevelSet;
424  msLevelSet.insert(1);
425 
427 
428  if (os_)
429  {
430  printSpectrumList(filter, *os_);
431  *os_ << endl;
432  }
433 
434  unit_assert(filter.size() == 4);
435  unit_assert(filter.spectrumIdentity(0).id == "scan=100");
436  unit_assert(filter.spectrumIdentity(1).id == "scan=103");
437  unit_assert(filter.spectrumIdentity(2).id == "scan=106");
438  unit_assert(filter.spectrumIdentity(3).id == "scan=109");
439 
440  IntegerSet msLevelSet2;
441  msLevelSet2.insert(2);
442 
444 
445  if (os_)
446  {
447  printSpectrumList(filter2, *os_);
448  *os_ << endl;
449  }
450 
451  unit_assert(filter2.size() == 6);
452  unit_assert(filter2.spectrumIdentity(0).id == "scan=101");
453  unit_assert(filter2.spectrumIdentity(1).id == "scan=102");
454  unit_assert(filter2.spectrumIdentity(2).id == "scan=104");
455  unit_assert(filter2.spectrumIdentity(3).id == "scan=105");
456  unit_assert(filter2.spectrumIdentity(4).id == "scan=107");
457  unit_assert(filter2.spectrumIdentity(5).id == "scan=108");
458 }
459 
461 {
462  if (os_) *os_ << "testMS2Activation:\n";
463 
465 
466  set<CVID> cvIDs;
467  // CID
468  cvIDs.insert(MS_electron_transfer_dissociation);
469  cvIDs.insert(MS_HCD);
470  cvIDs.insert(MS_IRMPD);
471  SpectrumList_Filter filter(ms2filter,
473 
474  if (os_)
475  {
476  printSpectrumList(filter, *os_);
477  *os_ << endl;
478  }
479 
480  unit_assert(filter.size() == 1);
481  unit_assert(filter.spectrumIdentity(0).id == "scan=102");
482 
483  // ETD + SA
484  cvIDs.clear();
485  cvIDs.insert(MS_electron_transfer_dissociation);
486  cvIDs.insert(MS_collision_induced_dissociation);
487  SpectrumList_Filter filter1(ms2filter,
489  if (os_)
490  {
491  printSpectrumList(filter1, *os_);
492  *os_ << endl;
493  }
494 
495  unit_assert(filter1.size() == 1);
496  unit_assert(filter1.spectrumIdentity(0).id == "scan=107");
497 
498  // ETD
499  cvIDs.clear();
500  cvIDs.insert(MS_electron_transfer_dissociation);
501  SpectrumList_Filter filter2(ms2filter,
503  if (os_)
504  {
505  printSpectrumList(filter2, *os_);
506  *os_ << endl;
507  }
508 
509  unit_assert(filter2.size() == 3);
510  unit_assert(filter2.spectrumIdentity(0).id == "scan=101");
511  unit_assert(filter2.spectrumIdentity(1).id == "scan=105");
512  unit_assert(filter2.spectrumIdentity(2).id == "scan=107");
513 
514  // HCD
515  cvIDs.clear();
516  cvIDs.insert(MS_HCD);
517  SpectrumList_Filter filter3(ms2filter,
519  if (os_)
520  {
521  printSpectrumList(filter3, *os_);
522  *os_ << endl;
523  }
524 
525  unit_assert(filter3.size() == 1);
526  unit_assert(filter3.spectrumIdentity(0).id == "scan=104");
527 
528  // IRMPD
529  cvIDs.clear();
530  cvIDs.insert(MS_IRMPD);
531  SpectrumList_Filter filter4(ms2filter,
533  if (os_)
534  {
535  printSpectrumList(filter4, *os_);
536  *os_ << endl;
537  }
538 
539  unit_assert(filter4.size() == 1);
540  unit_assert(filter4.spectrumIdentity(0).id == "scan=108");
541 
542 }
543 
545 {
546  if (os_) *os_ << "testMassAnalyzerFilter:\n";
547 
548  set<CVID> cvIDs;
549  // msconvert mass analyzer filter FTMS option
550  cvIDs.insert(MS_orbitrap);
554 
555  if (os_)
556  {
557  printSpectrumList(filter, *os_);
558  *os_ << endl;
559  }
560 
561  unit_assert(filter.size() == 7);
562  unit_assert(filter.spectrumIdentity(0).id == "scan=100");
563 
564  cvIDs.clear();
565  // msconvert mass analyzer filter ITMS option
566  cvIDs.insert(MS_ion_trap);
567 
568  SpectrumList_Filter filter1(sl,
570 
571  if (os_)
572  {
573  printSpectrumList(filter1, *os_);
574  *os_ << endl;
575  }
576 
577  unit_assert(filter1.size() == 3);
578  unit_assert(filter1.spectrumIdentity(0).id == "scan=102");
579 }
580 
582 {
583  if (os_) *os_ << "testMZPresentFilter:\n";
584 
585  // test mzpresent on MS level 2 (include test)
587  chemistry::MZTolerance mzt(3.0);
588  std::set<double> mzSet;
589  mzSet.insert(200.0);
590  mzSet.insert(300.0);
591  mzSet.insert(400.0);
592  double threshold = 10;
593  IntegerSet msLevels(1, INT_MAX);
594  ThresholdFilter tf(ThresholdFilter::ThresholdingBy_Count, threshold, ThresholdFilter::Orientation_MostIntense, msLevels);
595  SpectrumList_Filter filter(ms2filter, SpectrumList_FilterPredicate_MzPresent(mzt, mzSet, tf, false));
596 
597  if (os_)
598  {
599  printSpectrumList(filter, *os_);
600  *os_ << endl;
601  }
602  unit_assert(filter.size() == 4);
603  unit_assert(filter.spectrumIdentity(0).id == "scan=102");
604  unit_assert(filter.spectrumIdentity(1).id == "scan=104");
605  unit_assert(filter.spectrumIdentity(2).id == "scan=105");
606  unit_assert(filter.spectrumIdentity(3).id == "scan=107");
607 
608  // test mz present on MS level 1 (exclude test)
610  chemistry::MZTolerance mzt1(3.0);
611  std::set<double> mzSet1;
612  mzSet1.insert(200.0);
613  mzSet1.insert(300.0);
614  double threshold1 = 5;
615  ThresholdFilter tf1(ThresholdFilter::ThresholdingBy_Count, threshold1, ThresholdFilter::Orientation_MostIntense, msLevels);
616  SpectrumList_Filter filter1(ms1filter, SpectrumList_FilterPredicate_MzPresent(mzt1, mzSet1, tf1, true));
617 
618  if (os_)
619  {
620  printSpectrumList(filter1, *os_);
621  *os_ << endl;
622  }
623  unit_assert(filter1.size() == 3);
624  unit_assert(filter1.spectrumIdentity(0).id == "scan=100");
625  unit_assert(filter1.spectrumIdentity(1).id == "scan=106");
626  unit_assert(filter1.spectrumIdentity(2).id == "scan=109");
627 }
628 
629 void test()
630 {
632  testEven(sl);
633  testEvenMS2(sl);
635  testHasBinaryData(sl);
636  testIndexSet(sl);
637  testScanNumberSet(sl);
638  testScanEventSet(sl);
639  testScanTimeRange(sl);
640  testMSLevelSet(sl);
641  testMS2Activation(sl);
644 }
645 
646 
647 int main(int argc, char* argv[])
648 {
649  TEST_PROLOG(argc, argv)
650 
651  try
652  {
653  if (argc>1 && !strcmp(argv[1],"-v")) os_ = &cout;
654  test();
655  }
656  catch (exception& e)
657  {
658  TEST_FAILED(e.what())
659  }
660  catch (...)
661  {
662  TEST_FAILED("Caught unknown exception.")
663  }
664 
666 }
667 
668 
virtual tribool accept(const SpectrumIdentity &spectrumIdentity) const
return values: true: accept the Spectrum false: reject the Spectrum indeterminate: need to see the fu...
void testEvenMS2(SpectrumListPtr sl)
MS_MSn_spectrum
MSn spectrum: MSn refers to multi-stage MS2 experiments designed to record product ion spectra where ...
Definition: cv.hpp:2212
CVParam cvParam(CVID cvid) const
finds cvid in the container:
MS_mass_spectrum
mass spectrum: A plot of the relative abundance of a beam or other collection of ions as a function o...
Definition: cv.hpp:1291
MSData <-> mzML stream serialization.
void read(boost::shared_ptr< std::istream > is, MSData &msd) const
read in MSData object from an mzML istream note: istream may be managed by MSData&#39;s SpectrumList...
a virtual container of integers, accessible via an iterator interface, stored as union of intervals ...
Definition: IntegerSet.hpp:37
The method of precursor ion selection and activation.
Definition: MSData.hpp:310
std::vector< BinaryDataArrayPtr > binaryDataArrayPtrs
list of binary data arrays.
Definition: MSData.hpp:525
A component of an instrument corresponding to a source (i.e. ion source), an analyzer (i...
Definition: MSData.hpp:130
void testScanNumberSet(SpectrumListPtr sl)
virtual msdata::SpectrumPtr spectrum(size_t index, bool getBinaryData=false) const
retrieve a spectrum by index
boost::shared_ptr< Spectrum > SpectrumPtr
Definition: MSData.hpp:569
void write(std::ostream &os, const MSData &msd, const pwiz::util::IterationListenerRegistry *iterationListenerRegistry=0) const
write MSData object to ostream as mzML; iterationListenerRegistry may be used to receive progress upd...
MS_scan_start_time
scan start time: The time that an analyzer started a scan, relative to the start of the MS run...
Definition: cv.hpp:148
ostream * os_
void testMSLevelSet(SpectrumListPtr sl)
virtual tribool accept(const msdata::SpectrumIdentity &spectrumIdentity) const
return values: true: accept the Spectrum false: reject the Spectrum indeterminate: need to see the fu...
#define TEST_EPILOG
Definition: unit.hpp:182
MS_fourier_transform_ion_cyclotron_resonance_mass_spectrometer
fourier transform ion cyclotron resonance mass spectrometer: A mass spectrometer based on the princip...
Definition: cv.hpp:373
virtual size_t size() const
returns the number of spectra
SpectrumListPtr createSpectrumList()
MS_collision_induced_dissociation
collision-induced dissociation: The dissociation of an ion after collisional excitation. The term collisional-activated dissociation is not recommended.
Definition: cv.hpp:586
virtual SpectrumPtr spectrum(size_t index, bool getBinaryData=false) const =0
retrieve a spectrum by index
PWIZ_API_DECL void initializeTiny(MSData &msd)
virtual size_t size() const =0
returns the number of spectra
void testScanTimeRange(SpectrumListPtr sl)
MS_ms_level
ms level: Stages of ms achieved in a multi stage mass spectrometry experiment.
Definition: cv.hpp:1987
float lexical_cast(const std::string &str)
Interface for accessing spectra, which may be stored in memory or backed by a data file (RAW...
Definition: MSData.hpp:656
UO_second
second: A time unit which is equal to the duration of 9 192 631 770 periods of the radiation correspo...
Definition: cv.hpp:12526
client-implemented filter predicate – called during construction of SpectrumList_Filter to create t...
void testMS2Activation(SpectrumListPtr sl)
virtual tribool accept(const SpectrumIdentity &spectrumIdentity) const
return values: true: accept the Spectrum false: reject the Spectrum indeterminate: need to see the fu...
MS_electron_transfer_dissociation
electron transfer dissociation: A process to fragment ions in a mass spectrometer by inducing fragmen...
Definition: cv.hpp:2296
void testScanEventSet(SpectrumListPtr sl)
std::string id
a unique identifier for this spectrum. It should be expected that external files may use this identif...
Definition: MSData.hpp:475
MS_radial_ejection_linear_ion_trap
radial ejection linear ion trap: A linear ion trap mass spectrometer where ions are ejected along the...
Definition: cv.hpp:397
MS_IRMPD
IRMPD (infrared multiphoton dissociation): Multiphoton ionization where the reactant ion dissociates ...
Definition: cv.hpp:1117
The data point type of a mass spectrum.
Definition: MSData.hpp:421
#define unit_assert_operator_equal(expected, actual)
Definition: unit.hpp:92
Run run
a run in mzML should correspond to a single, consecutive and coherent set of scans on an instrument...
Definition: MSData.hpp:882
MS_MS1_spectrum
MS1 spectrum: Mass spectrum created by a single-stage MS experiment or the first stage of a multi-sta...
Definition: cv.hpp:2197
boost::shared_ptr< SpectrumList > SpectrumListPtr
Definition: MSData.hpp:707
void testSelectedIndices(SpectrumListPtr sl)
virtual DetailLevel suggestedDetailLevel() const
can be overridden in subclasses that know they will need a certain detail level; it must be overridde...
size_t index
the zero-based, consecutive index of the spectrum in the SpectrumList.
Definition: MSData.hpp:472
virtual tribool accept(const Spectrum &spectrum) const
return true iff Spectrum is accepted
virtual bool done() const
return true iff done accepting proteins; this allows early termination of the iteration through the o...
MS_spectrum_type
spectrum type: Spectrum type.
Definition: cv.hpp:2134
MS_preset_scan_configuration
preset scan configuration: A user-defined scan configuration that specifies the instrumental settings...
Definition: cv.hpp:2359
void testMZPresentFilter(SpectrumListPtr sl)
Description of a particular hardware configuration of a mass spectrometer. Each configuration MUST ha...
Definition: MSData.hpp:228
boost::shared_ptr< InstrumentConfiguration > InstrumentConfigurationPtr
Definition: MSData.hpp:249
void testHasBinaryData(SpectrumListPtr sl)
SpectrumListPtr spectrumListPtr
all mass spectra and the acquisitions underlying them are described and attached here. Subsidiary data arrays are also both described and attached here.
Definition: MSData.hpp:823
virtual bool empty() const
returns true iff (size() == 0) and (dataProcessingPtr.get() == NULL)
Identifying information for a spectrum.
Definition: MSData.hpp:469
void printSpectrumList(const SpectrumList &sl, ostream &os)
#define TEST_FAILED(x)
Definition: unit.hpp:176
MS_number_of_detector_counts
number of detector counts: The number of counted events observed in one or a group of elements of a d...
Definition: cv.hpp:580
CVID_Unknown
Definition: cv.hpp:97
virtual tribool accept(const SpectrumIdentity &spectrumIdentity) const
return values: true: accept the Spectrum false: reject the Spectrum indeterminate: need to see the fu...
void testMassAnalyzerFilter(SpectrumListPtr sl)
struct for expressing m/z tolerance in either amu or ppm
Definition: MZTolerance.hpp:38
MS_ion_trap
ion trap: A device for spatially confining ions using electric and magnetic fields alone or in combin...
Definition: cv.hpp:1126
HasBinaryDataPredicate(DetailLevel suggestedDetailLevel)
#define TEST_PROLOG(argc, argv)
Definition: unit.hpp:174
boost::shared_ptr< SpectrumListSimple > SpectrumListSimplePtr
Definition: MSData.hpp:727
SpectrumList filter, for creating Spectrum sub-lists.
The structure that captures the generation of a peak list (including the underlying acquisitions) ...
Definition: MSData.hpp:504
virtual tribool accept(const Spectrum &spectrum) const
return true iff Spectrum is accepted
CVParam cvParamChild(CVID cvid) const
finds child of cvid in the container:
value_type valueAs() const
templated value access with type conversion
Definition: ParamTypes.hpp:112
This is the root element of ProteoWizard; it represents the mzML element, defined as: intended to cap...
Definition: MSData.hpp:845
virtual const msdata::SpectrumIdentity & spectrumIdentity(size_t index) const
access to a spectrum index
void insert(Interval interval)
insert an interval of integers into the virtual container
Simple writeable in-memory implementation of SpectrumList.
Definition: MSData.hpp:712
#define unit_assert(x)
Definition: unit.hpp:85
MS_orbitrap
orbitrap: An ion trapping device that consists of an outer barrel-like electrode and a coaxial inner ...
Definition: cv.hpp:1900
int main(int argc, char *argv[])
void testEven(SpectrumListPtr sl)
PWIZ_API_DECL bool cvIsA(CVID child, CVID parent)
returns true iff child IsA parent in the CV
MS_HCD
HCD (beam-type collision-induced dissociation): A collision-induced dissociation process that occurs ...
Definition: cv.hpp:1690
represents a tag-value pair, where the tag comes from the controlled vocabulary
Definition: ParamTypes.hpp:44
void filter(const TContainer &data, const TContainer &filter, TContainer &result, bool circular=false, uint32_t sides=2)
Applies linear convolution (filtering) to a univariate time series.
Definition: filter.hpp:112
void testIndexSet(SpectrumListPtr sl)