OpenMS
ChromatogramExtractor.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Hannes Roest $
6 // $Authors: Hannes Roest $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
12 
16 
19 
20 namespace OpenMS
21 {
22 
41  class OPENMS_DLLAPI ChromatogramExtractor :
42  public ProgressLogger
43  {
44 
45 public:
46 
48 
69  template <typename ExperimentT>
70  void extractChromatograms(const ExperimentT& input,
71  ExperimentT& output,
72  OpenMS::TargetedExperiment& transition_exp,
73  double mz_extraction_window,
74  bool ppm, TransformationDescription trafo,
75  double rt_extraction_window,
76  const String& filter)
77  {
78  // invert the trafo because we want to transform nRT values to "real" RT values
79  trafo.invert();
80 
81  Size input_size = input.size();
82  if (input_size < 1)
83  {
84  return;
85  }
86 
87  int used_filter = getFilterNr_(filter);
88  populatePeptideRTMap_(transition_exp, rt_extraction_window);
89 
90  // sort the transition experiment by product mass
91  // this is essential because the algorithm assumes sorted transitions!
92  transition_exp.sortTransitionsByProductMZ();
93 
94  // prepare all the spectra (but leave them empty)
95  SpectrumSettings settings = input[0];
96  std::vector<typename ExperimentT::ChromatogramType> chromatograms;
97  prepareSpectra_(settings, chromatograms, transition_exp);
98 
99  //go through all spectra
100  startProgress(0, input_size, "Extracting chromatograms");
101  for (Size scan_idx = 0; scan_idx < input_size; ++scan_idx)
102  {
103  setProgress(scan_idx);
104 
105  if (input[scan_idx].size() == 0)
106  continue;
107 
108  Size peak_idx = 0;
109 
110  double mz;
111  double integrated_intensity = 0;
112 
113  // go through all transitions / chromatograms which are sorted by
114  // ProductMZ. We can use this to step through the spectrum and at the
115  // same time step through the transitions. We increase the peak counter
116  // until we hit the next transition and then extract the signal.
117  for (Size k = 0; k < chromatograms.size(); ++k)
118  {
119 
120  double current_rt = input[scan_idx].getRT();
121  if (outsideExtractionWindow_(transition_exp.getTransitions()[k], current_rt, trafo, rt_extraction_window))
122  {
123  continue;
124  }
125 
127  mz = transition_exp.getTransitions()[k].getProductMZ();
128 
129  if (used_filter == 1)
130  {
131  extract_value_tophat(input[scan_idx], mz, peak_idx, integrated_intensity, mz_extraction_window, ppm);
132  }
133  else if (used_filter == 2)
134  {
135  extract_value_bartlett(input[scan_idx], mz, peak_idx, integrated_intensity, mz_extraction_window, ppm);
136  }
137 
138 
139  p.setRT(current_rt);
140  p.setIntensity(integrated_intensity);
141  chromatograms[k].push_back(p);
142  }
143  }
144  endProgress();
145 
146  // add all the chromatograms to the output
147  output.setChromatograms(chromatograms);
148  }
149 
168  std::vector< OpenSwath::ChromatogramPtr >& output,
169  const std::vector<ExtractionCoordinates>& extraction_coordinates,
170  double mz_extraction_window,
171  bool ppm,
172  const String& filter)
173  {
175  extraction_coordinates, mz_extraction_window, ppm, -1, filter);
176  }
177 
197  std::vector< OpenSwath::ChromatogramPtr >& output,
198  const std::vector<ExtractionCoordinates>& extraction_coordinates,
199  double mz_extraction_window,
200  bool ppm,
201  double im_extraction_window,
202  const String& filter)
203  {
205  extraction_coordinates, mz_extraction_window, ppm, im_extraction_window, filter);
206  }
207 
229  static void prepare_coordinates(std::vector< OpenSwath::ChromatogramPtr > & output_chromatograms,
230  std::vector< ExtractionCoordinates > & coordinates,
231  const OpenMS::TargetedExperiment & transition_exp,
232  const double rt_extraction_window,
233  const bool ms1 = false,
234  const int ms1_isotopes = 0);
235 
236  static void prepare_coordinates(std::vector< OpenSwath::ChromatogramPtr > & output_chromatograms,
237  std::vector< ExtractionCoordinates > & coordinates,
238  const OpenSwath::LightTargetedExperiment & transition_exp_used,
239  const double rt_extraction_window,
240  const bool ms1 = false,
241  const int ms1_isotopes = 0);
242 
257  template <typename TransitionExpT>
258  static void return_chromatogram(const std::vector< OpenSwath::ChromatogramPtr > & chromatograms,
259  const std::vector< ChromatogramExtractor::ExtractionCoordinates > & coordinates,
260  TransitionExpT& transition_exp_used,
261  SpectrumSettings settings,
262  std::vector<OpenMS::MSChromatogram > & output_chromatograms,
263  bool ms1,
264  double im_extraction_width = 0.0)
265  {
266  typedef std::map<String, const typename TransitionExpT::Transition* > TransitionMapType;
267  TransitionMapType trans_map;
268  for (Size i = 0; i < transition_exp_used.getTransitions().size(); i++)
269  {
270  trans_map[transition_exp_used.getTransitions()[i].getNativeID()] = &transition_exp_used.getTransitions()[i];
271  }
272 
273  for (Size i = 0; i < chromatograms.size(); i++)
274  {
275  const OpenSwath::ChromatogramPtr & chromptr = chromatograms[i];
276  const ChromatogramExtractor::ExtractionCoordinates & coord = coordinates[i];
277 
278  // copy data
281  chrom.setNativeID(coord.id);
282 
283  // Create precursor and set
284  // 1) the target m/z
285  // 2) the isolation window (upper/lower)
286  // 3) the peptide sequence
287  Precursor prec;
288  if (ms1)
289  {
290  prec.setMZ(coord.mz);
292 
293  // extract compound / peptide id from transition and store in
294  // more-or-less default field
295  String transition_group_id = OpenSwathHelper::computeTransitionGroupId(coord.id);
296  if (!transition_group_id.empty())
297  {
298  int prec_charge = 0;
299  String r = extract_id_(transition_exp_used, transition_group_id, prec_charge);
300  prec.setCharge(prec_charge);
301  prec.setMetaValue("peptide_sequence", r);
302  }
303  }
304  else
305  {
306  typename TransitionExpT::Transition transition = (*trans_map[coord.id]);
307 
308  prec.setMZ(transition.getPrecursorMZ());
309  if (!settings.getPrecursors().empty())
310  {
311  prec.setIsolationWindowLowerOffset(settings.getPrecursors()[0].getIsolationWindowLowerOffset());
312  prec.setIsolationWindowUpperOffset(settings.getPrecursors()[0].getIsolationWindowUpperOffset());
313  }
314 
315  // Create product and set its m/z
316  Product prod;
317  prod.setMZ(transition.getProductMZ());
318  chrom.setProduct(prod);
320 
321  // extract compound / peptide id from transition and store in
322  // more-or-less default field
323  if (!transition.getPeptideRef().empty())
324  {
325  int prec_charge = 0;
326  String r = extract_id_(transition_exp_used, transition.getPeptideRef(), prec_charge);
327  prec.setCharge(prec_charge);
328  prec.setMetaValue("peptide_sequence", r);
329  }
330  else
331  {
332  int prec_charge = 0;
333  String r = extract_id_(transition_exp_used, transition.getCompoundRef(), prec_charge);
334  prec.setCharge(prec_charge);
335  prec.setMetaValue("peptide_sequence", r);
336  }
337  }
338 
339  if (coord.ion_mobility >= 0 && im_extraction_width > 0.0)
340  {
341  prec.setDriftTime(coord.ion_mobility);
342  prec.setDriftTimeWindowLowerOffset(im_extraction_width / 2.0);
343  prec.setDriftTimeWindowUpperOffset(im_extraction_width / 2.0);
344  }
345  chrom.setPrecursor(prec);
346 
347  // Set the rest of the meta-data
349  chrom.setAcquisitionInfo(settings.getAcquisitionInfo());
350  chrom.setSourceFile(settings.getSourceFile());
351 
352  for (Size j = 0; j < settings.getDataProcessing().size(); ++j)
353  {
354  settings.getDataProcessing()[j]->setMetaValue("performed_on_spectra", "true");
355  chrom.getDataProcessing().push_back(settings.getDataProcessing()[j]);
356  }
357  output_chromatograms.push_back(chrom);
358  }
359  }
360 
362  template <typename SpectrumT>
363  void extract_value_tophat(const SpectrumT& input,
364  const double mz,
365  Size& peak_idx,
366  double& integrated_intensity,
367  const double extract_window,
368  const bool ppm)
369  {
370  integrated_intensity = 0;
371  if (input.size() == 0)
372  {
373  return;
374  }
375 
376  // calculate extraction window
377  double left, right;
378  if (ppm)
379  {
380  left = mz - mz * extract_window / 2.0 * 1.0e-6;
381  right = mz + mz * extract_window / 2.0 * 1.0e-6;
382  }
383  else
384  {
385  left = mz - extract_window / 2.0;
386  right = mz + extract_window / 2.0;
387  }
388 
389  Size walker;
390 
391  // advance the peak_idx until we hit the m/z value of the next transition
392  while (peak_idx < input.size() && input[peak_idx].getMZ() < mz)
393  {
394  peak_idx++;
395  }
396 
397  // walk right and left and add to our intensity
398  walker = peak_idx;
399  // if we moved past the end of the spectrum, we need to try the last peak
400  // of the spectrum (it could still be within the window)
401  if (peak_idx >= input.size())
402  {
403  walker = input.size() - 1;
404  }
405 
406  // add the current peak if it is between right and left
407  if (input[walker].getMZ() > left && input[walker].getMZ() < right)
408  {
409  integrated_intensity += input[walker].getIntensity();
410  }
411 
412  // (i) Walk to the left one step and then keep walking left until we go
413  // outside the window. Note for the first step to the left we have to
414  // check for the walker becoming zero.
415  walker = peak_idx;
416  if (walker > 0)
417  {
418  walker--;
419  // special case: walker is now zero
420  if (walker == 0 && input[walker].getMZ() > left && input[walker].getMZ() < right)
421  {
422  integrated_intensity += input[walker].getIntensity();
423  }
424  }
425  while (walker > 0 && input[walker].getMZ() > left && input[walker].getMZ() < right)
426  {
427  integrated_intensity += input[walker].getIntensity(); walker--;
428  }
429 
430  // (ii) Walk to the right one step and then keep walking right until we
431  // are outside the window
432  walker = peak_idx;
433  if (walker < input.size() )
434  {
435  walker++;
436  }
437  while (walker < input.size() && input[walker].getMZ() > left && input[walker].getMZ() < right)
438  {
439  integrated_intensity += input[walker].getIntensity(); walker++;
440  }
441  }
442 
444  template <typename SpectrumT>
445  void extract_value_bartlett(const SpectrumT& input,
446  const double mz,
447  Size& peak_idx,
448  double& integrated_intensity,
449  const double extract_window,
450  const bool ppm)
451  {
452  integrated_intensity = 0;
453  if (input.size() == 0)
454  {
455  return;
456  }
457 
458  // calculate extraction window
459  double left, right, half_window_size, weight;
460  if (ppm)
461  {
462  half_window_size = mz * extract_window / 2.0 * 1.0e-6;
463  left = mz - mz * extract_window / 2.0 * 1.0e-6;
464  right = mz + mz * extract_window / 2.0 * 1.0e-6;
465  }
466  else
467  {
468  half_window_size = extract_window / 2.0;
469  left = mz - extract_window / 2.0;
470  right = mz + extract_window / 2.0;
471  }
472 
473  Size walker;
474 
475  // advance the peak_idx until we hit the m/z value of the next transition
476  while (peak_idx < input.size() && input[peak_idx].getMZ() < mz)
477  {
478  peak_idx++;
479  }
480 
481  // walk right and left and add to our intensity
482  walker = peak_idx;
483  // if we moved past the end of the spectrum, we need to try the last peak
484  // of the spectrum (it could still be within the window)
485  if (peak_idx >= input.size())
486  {
487  walker = input.size() - 1;
488  }
489 
490  // add the current peak if it is between right and left
491  if (input[walker].getMZ() > left && input[walker].getMZ() < right)
492  {
493  weight = 1 - fabs(input[walker].getMZ() - mz) / half_window_size;
494  integrated_intensity += input[walker].getIntensity() * weight;
495  }
496 
497  // (i) Walk to the left one step and then keep walking left until we go
498  // outside the window. Note for the first step to the left we have to
499  // check for the walker becoming zero.
500  walker = peak_idx;
501  if (walker > 0)
502  {
503  walker--;
504  // special case: walker is now zero
505  if (walker == 0 && input[walker].getMZ() > left && input[walker].getMZ() < right)
506  {
507  integrated_intensity += input[walker].getIntensity();
508  }
509  }
510  while (walker > 0 && input[walker].getMZ() > left && input[walker].getMZ() < right)
511  {
512  weight = 1 - fabs(input[walker].getMZ() - mz) / half_window_size;
513  integrated_intensity += input[walker].getIntensity() * weight; walker--;
514  }
515 
516  // (ii) Walk to the right one step and then keep walking right until we
517  // are outside the window
518  walker = peak_idx;
519  if (walker < input.size() )
520  {
521  walker++;
522  }
523  while (walker<input.size() && input[walker].getMZ()> left && input[walker].getMZ() < right)
524  {
525  weight = 1 - fabs(input[walker].getMZ() - mz) / half_window_size;
526  integrated_intensity += input[walker].getIntensity() * weight; walker++;
527  }
528  }
529 
530 private:
539  template <typename TransitionExpT>
540  static String extract_id_(TransitionExpT& transition_exp_used, const String& id, int& prec_charge);
541 
556  template <class SpectrumSettingsT, class ChromatogramT>
557  void prepareSpectra_(SpectrumSettingsT& settings,
558  std::vector<ChromatogramT>& chromatograms,
559  OpenMS::TargetedExperiment& transition_exp)
560  {
561  // first prepare all the spectra (but leave them empty)
562  for (Size i = 0; i < transition_exp.getTransitions().size(); i++)
563  {
564  const ReactionMonitoringTransition* transition = &transition_exp.getTransitions()[i];
565 
566  // 1) and 2) Extract precursor m/z and isolation window
567  ChromatogramT chrom;
568  Precursor prec;
569  prec.setMZ(transition->getPrecursorMZ());
570  if (settings.getPrecursors().size() > 0)
571  {
572  prec.setIsolationWindowLowerOffset(settings.getPrecursors()[0].getIsolationWindowLowerOffset());
573  prec.setIsolationWindowUpperOffset(settings.getPrecursors()[0].getIsolationWindowUpperOffset());
574  }
575 
576  // 3) set precursor peptide sequence / compound id in more-or-less default field
577  String pepref = transition->getPeptideRef();
578  for (Size pep_idx = 0; pep_idx < transition_exp.getPeptides().size(); pep_idx++)
579  {
580  const OpenMS::TargetedExperiment::Peptide* pep = &transition_exp.getPeptides()[pep_idx];
581  if (pep->id == pepref)
582  {
583  prec.setMetaValue("peptide_sequence", pep->sequence);
584  break;
585  }
586  }
587  String compref = transition->getCompoundRef();
588  for (Size comp_idx = 0; comp_idx < transition_exp.getCompounds().size(); comp_idx++)
589  {
590  const OpenMS::TargetedExperiment::Compound* comp = &transition_exp.getCompounds()[comp_idx];
591  if (comp->id == compref)
592  {
593  prec.setMetaValue("peptide_sequence", String(comp->id) );
594  break;
595  }
596  }
597 
598  // add precursor to spectrum
599  chrom.setPrecursor(prec);
600 
601  // 4) Create product and set its m/z
602  Product prod;
603  prod.setMZ(transition->getProductMZ());
604  chrom.setProduct(prod);
605 
606  // 5) Set the rest of the meta-data
607  chrom.setInstrumentSettings(settings.getInstrumentSettings());
608  chrom.setAcquisitionInfo(settings.getAcquisitionInfo());
609  chrom.setSourceFile(settings.getSourceFile());
610 
611  for (Size j = 0; j < settings.getDataProcessing().size(); ++j)
612  {
613  settings.getDataProcessing()[j]->setMetaValue("performed_on_spectra", "true");
614  chrom.getDataProcessing().push_back(settings.getDataProcessing()[j]);
615  }
616 
617  // Set the id of the chromatogram, using the id of the transition (this gives directly the mapping of the two)
618  chrom.setNativeID(transition->getNativeID());
620  chromatograms.push_back(chrom);
621  }
622 
623  }
624 
627  double current_rt,
628  const TransformationDescription& trafo,
629  double rt_extraction_window);
630 
632  int getFilterNr_(const String& filter);
633 
636  double rt_extraction_window);
637 
638  std::map<OpenMS::String, double> PeptideRTMap_;
639 
640  };
641 
642  // Specialization for template (LightTargetedExperiment)
643  template<>
644  inline String ChromatogramExtractor::extract_id_<OpenSwath::LightTargetedExperiment>(OpenSwath::LightTargetedExperiment& transition_exp_used,
645  const String& id,
646  int & prec_charge)
647  {
648  const OpenSwath::LightCompound comp = transition_exp_used.getCompoundByRef(id);
649  prec_charge = comp.charge;
650  if (!comp.sequence.empty())
651  {
652  return comp.sequence;
653  }
654  else
655  {
656  return comp.compound_name;
657  }
658  }
659 
660 
661  // Specialization for template (TargetedExperiment)
662  template<>
663  inline String ChromatogramExtractor::extract_id_<OpenMS::TargetedExperiment>(OpenMS::TargetedExperiment& transition_exp_used,
664  const String& id,
665  int & prec_charge)
666  {
667  if (transition_exp_used.hasPeptide(id))
668  {
669  const TargetedExperiment::Peptide p = transition_exp_used.getPeptideByRef(id);
670  if (p.hasCharge()) {prec_charge = p.getChargeState();}
671  return p.sequence;
672  }
673  else if (transition_exp_used.hasCompound(id))
674  {
675  const TargetedExperiment::Compound c = transition_exp_used.getCompoundByRef(id);
676  if (c.hasCharge()) {prec_charge = c.getChargeState();}
677  return c.id;
678  }
679  else
680  {
681  return "";
682  }
683  }
684 }
685 
The ChromatogramExtractorAlgorithm extracts chromatograms from a MS data.
Definition: ChromatogramExtractorAlgorithm.h:34
void extractChromatograms(const OpenSwath::SpectrumAccessPtr &input, std::vector< OpenSwath::ChromatogramPtr > &output, const std::vector< ExtractionCoordinates > &extraction_coordinates, double mz_extraction_window, bool ppm, double im_extraction_window, const String &filter)
Extract chromatograms at the m/z and RT defined by the ExtractionCoordinates.
The ChromatogramExtractor extracts chromatograms from a spectra file.
Definition: ChromatogramExtractor.h:43
static void prepare_coordinates(std::vector< OpenSwath::ChromatogramPtr > &output_chromatograms, std::vector< ExtractionCoordinates > &coordinates, const OpenMS::TargetedExperiment &transition_exp, const double rt_extraction_window, const bool ms1=false, const int ms1_isotopes=0)
Prepare the extraction coordinates from a TargetedExperiment.
ChromatogramExtractorAlgorithm::ExtractionCoordinates ExtractionCoordinates
Definition: ChromatogramExtractor.h:47
void extract_value_tophat(const SpectrumT &input, const double mz, Size &peak_idx, double &integrated_intensity, const double extract_window, const bool ppm)
Definition: ChromatogramExtractor.h:363
int getFilterNr_(const String &filter)
static void prepare_coordinates(std::vector< OpenSwath::ChromatogramPtr > &output_chromatograms, std::vector< ExtractionCoordinates > &coordinates, const OpenSwath::LightTargetedExperiment &transition_exp_used, const double rt_extraction_window, const bool ms1=false, const int ms1_isotopes=0)
void extractChromatograms(const OpenSwath::SpectrumAccessPtr input, std::vector< OpenSwath::ChromatogramPtr > &output, const std::vector< ExtractionCoordinates > &extraction_coordinates, double mz_extraction_window, bool ppm, const String &filter)
Extract chromatograms at the m/z and RT defined by the ExtractionCoordinates.
Definition: ChromatogramExtractor.h:167
void extractChromatograms(const OpenSwath::SpectrumAccessPtr input, std::vector< OpenSwath::ChromatogramPtr > &output, const std::vector< ExtractionCoordinates > &extraction_coordinates, double mz_extraction_window, bool ppm, double im_extraction_window, const String &filter)
Extract chromatograms at the m/z and RT defined by the ExtractionCoordinates.
Definition: ChromatogramExtractor.h:196
void extractChromatograms(const ExperimentT &input, ExperimentT &output, OpenMS::TargetedExperiment &transition_exp, double mz_extraction_window, bool ppm, TransformationDescription trafo, double rt_extraction_window, const String &filter)
Extract chromatograms defined by the TargetedExperiment from the input map and write them to the outp...
Definition: ChromatogramExtractor.h:70
void prepareSpectra_(SpectrumSettingsT &settings, std::vector< ChromatogramT > &chromatograms, OpenMS::TargetedExperiment &transition_exp)
This populates the chromatograms vector with empty chromatograms (but sets their meta-information)
Definition: ChromatogramExtractor.h:557
bool outsideExtractionWindow_(const ReactionMonitoringTransition &transition, double current_rt, const TransformationDescription &trafo, double rt_extraction_window)
static void return_chromatogram(const std::vector< OpenSwath::ChromatogramPtr > &chromatograms, const std::vector< ChromatogramExtractor::ExtractionCoordinates > &coordinates, TransitionExpT &transition_exp_used, SpectrumSettings settings, std::vector< OpenMS::MSChromatogram > &output_chromatograms, bool ms1, double im_extraction_width=0.0)
This converts the ChromatogramPtr to MSChromatogram and adds meta-information.
Definition: ChromatogramExtractor.h:258
std::map< OpenMS::String, double > PeptideRTMap_
Definition: ChromatogramExtractor.h:638
void extract_value_bartlett(const SpectrumT &input, const double mz, Size &peak_idx, double &integrated_intensity, const double extract_window, const bool ppm)
Definition: ChromatogramExtractor.h:445
void populatePeptideRTMap_(OpenMS::TargetedExperiment &transition_exp, double rt_extraction_window)
static String extract_id_(TransitionExpT &transition_exp_used, const String &id, int &prec_charge)
Extracts id (peptide sequence or compound name) for a compound.
void setPrecursor(const Precursor &precursor)
sets the precursors
void setProduct(const Product &product)
sets the products
void setInstrumentSettings(const InstrumentSettings &instrument_settings)
sets the instrument settings of the current spectrum
@ BASEPEAK_CHROMATOGRAM
Definition: ChromatogramSettings.h:46
@ SELECTED_REACTION_MONITORING_CHROMATOGRAM
Definition: ChromatogramSettings.h:48
void setSourceFile(const SourceFile &source_file)
sets the source file
void setChromatogramType(ChromatogramType type)
sets the chromatogram type
std::vector< DataProcessingPtr > & getDataProcessing()
returns a mutable reference to the description of the applied processing
void setAcquisitionInfo(const AcquisitionInfo &acquisition_info)
sets the acquisition info
void setNativeID(const String &native_id)
sets the native identifier for the spectrum, used by the acquisition software.
The representation of a chromatogram.
Definition: MSChromatogram.h:31
void setMetaValue(const String &name, const DataValue &value)
Sets the DataValue corresponding to a name.
static void convertToOpenMSChromatogram(const OpenSwath::ChromatogramPtr &cptr, OpenMS::MSChromatogram &chromatogram)
Convert a ChromatogramPtr to an OpenMS Chromatogram.
static String computeTransitionGroupId(const String &precursor_id)
Compute transition group id.
Definition: OpenSwathHelper.h:56
void setMZ(CoordinateType mz)
Mutable access to m/z.
Definition: Peak1D.h:93
Precursor meta information.
Definition: Precursor.h:35
void setIsolationWindowUpperOffset(double bound)
sets the upper offset from the target m/z
void setDriftTime(double drift_time)
sets the ion mobility drift time in milliseconds
void setDriftTimeWindowUpperOffset(double drift_time)
sets the upper offset from the target ion mobility
void setDriftTimeWindowLowerOffset(double drift_time)
sets the lower offset from the target ion mobility
void setIsolationWindowLowerOffset(double bound)
sets the lower offset from the target m/z
void setCharge(Int charge)
Mutable access to the charge.
Product meta information.
Definition: Product.h:24
void setMZ(double mz)
sets the target m/z
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:27
This class stores a SRM/MRM transition.
Definition: ReactionMonitoringTransition.h:32
double getPrecursorMZ() const
get the precursor mz (Q1 value)
const String & getCompoundRef() const
const String & getPeptideRef() const
const String & getNativeID() const
Representation of 1D spectrum settings.
Definition: SpectrumSettings.h:39
const SourceFile & getSourceFile() const
returns a const reference to the source file
const AcquisitionInfo & getAcquisitionInfo() const
returns a const reference to the acquisition info
const InstrumentSettings & getInstrumentSettings() const
returns a const reference to the instrument settings of the current spectrum
std::vector< DataProcessingPtr > & getDataProcessing()
returns a mutable reference to the description of the applied processing
const std::vector< Precursor > & getPrecursors() const
returns a const reference to the precursors
A more convenient string class.
Definition: String.h:34
Represents a compound (small molecule)
Definition: TargetedExperimentHelper.h:297
String id
Definition: TargetedExperimentHelper.h:280
int getChargeState() const
Return the peptide or compound charge state.
Definition: TargetedExperimentHelper.h:217
bool hasCharge() const
Whether peptide or compound has set charge state.
Definition: TargetedExperimentHelper.h:211
Represents a peptide (amino acid sequence)
Definition: TargetedExperimentHelper.h:334
String sequence
Definition: TargetedExperimentHelper.h:394
A description of a targeted experiment containing precursor and production ions.
Definition: TargetedExperiment.h:39
const Peptide & getPeptideByRef(const String &ref) const
const std::vector< Peptide > & getPeptides() const
const Compound & getCompoundByRef(const String &ref) const
const std::vector< ReactionMonitoringTransition > & getTransitions() const
returns the transition list
void sortTransitionsByProductMZ()
Lexicographically sorts the transitions by their product m/z.
bool hasCompound(const String &ref) const
bool hasPeptide(const String &ref) const
const std::vector< Compound > & getCompounds() const
Generic description of a coordinate transformation.
Definition: TransformationDescription.h:37
void invert()
Computes an (approximate) inverse of the transformation.
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:101
const double c
Definition: Constants.h:188
const double k
Definition: Constants.h:132
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22
Peak2D PeakType
Definition: MassTrace.h:21
boost::shared_ptr< Chromatogram > ChromatogramPtr
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:146
boost::shared_ptr< ISpectrumAccess > SpectrumAccessPtr
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:61
Definition: ChromatogramExtractorAlgorithm.h:39
double mz
m/z value around which should be extracted
Definition: ChromatogramExtractorAlgorithm.h:40
double ion_mobility
ion mobility value around which should be extracted
Definition: ChromatogramExtractorAlgorithm.h:41
std::string id
identifier
Definition: ChromatogramExtractorAlgorithm.h:45
Definition: TransitionExperiment.h:127
std::string sequence
Definition: TransitionExperiment.h:138
std::string compound_name
Definition: TransitionExperiment.h:147
int charge
Definition: TransitionExperiment.h:137
Definition: TransitionExperiment.h:185
const LightCompound & getCompoundByRef(const std::string &ref)
Definition: TransitionExperiment.h:232