OpenMS  2.4.0
ChromatogramExtractor.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2018.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Hannes Roest $
32 // $Authors: Hannes Roest $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
38 
42 
44 
45 namespace OpenMS
46 {
47 
66  class OPENMS_DLLAPI ChromatogramExtractor :
67  public ProgressLogger
68  {
69 
70 public:
71 
73 
94  template <typename ExperimentT>
95  void extractChromatograms(const ExperimentT& input,
96  ExperimentT& output,
97  OpenMS::TargetedExperiment& transition_exp,
98  double mz_extraction_window,
99  bool ppm, TransformationDescription trafo,
100  double rt_extraction_window,
101  const String& filter)
102  {
103  // invert the trafo because we want to transform nRT values to "real" RT values
104  trafo.invert();
105 
106  Size input_size = input.size();
107  if (input_size < 1)
108  {
109  return;
110  }
111 
112  int used_filter = getFilterNr_(filter);
113  populatePeptideRTMap_(transition_exp, rt_extraction_window);
114 
115  // sort the transition experiment by product mass
116  // this is essential because the algorithm assumes sorted transitions!
117  transition_exp.sortTransitionsByProductMZ();
118 
119  // prepare all the spectra (but leave them empty)
120  SpectrumSettings settings = input[0];
121  std::vector<typename ExperimentT::ChromatogramType> chromatograms;
122  prepareSpectra_(settings, chromatograms, transition_exp);
123 
124  //go through all spectra
125  startProgress(0, input_size, "Extracting chromatograms");
126  for (Size scan_idx = 0; scan_idx < input_size; ++scan_idx)
127  {
128  setProgress(scan_idx);
129 
130  if (input[scan_idx].size() == 0)
131  continue;
132 
133  Size peak_idx = 0;
134 
135  double mz;
136  double integrated_intensity = 0;
137 
138  // go through all transitions / chromatograms which are sorted by
139  // ProductMZ. We can use this to step through the spectrum and at the
140  // same time step through the transitions. We increase the peak counter
141  // until we hit the next transition and then extract the signal.
142  for (Size k = 0; k < chromatograms.size(); ++k)
143  {
144 
145  double current_rt = input[scan_idx].getRT();
146  if (outsideExtractionWindow_(transition_exp.getTransitions()[k], current_rt, trafo, rt_extraction_window))
147  {
148  continue;
149  }
150 
152  mz = transition_exp.getTransitions()[k].getProductMZ();
153 
154  if (used_filter == 1)
155  {
156  extract_value_tophat(input[scan_idx], mz, peak_idx, integrated_intensity, mz_extraction_window, ppm);
157  }
158  else if (used_filter == 2)
159  {
160  extract_value_bartlett(input[scan_idx], mz, peak_idx, integrated_intensity, mz_extraction_window, ppm);
161  }
162 
163 
164  p.setRT(current_rt);
165  p.setIntensity(integrated_intensity);
166  chromatograms[k].push_back(p);
167  }
168  }
169  endProgress();
170 
171  // add all the chromatograms to the output
172  output.setChromatograms(chromatograms);
173  }
174 
193  std::vector< OpenSwath::ChromatogramPtr >& output,
194  const std::vector<ExtractionCoordinates>& extraction_coordinates,
195  double mz_extraction_window,
196  bool ppm,
197  const String& filter)
198  {
200  extraction_coordinates, mz_extraction_window, ppm, -1, filter);
201  }
202 
222  std::vector< OpenSwath::ChromatogramPtr >& output,
223  const std::vector<ExtractionCoordinates>& extraction_coordinates,
224  double mz_extraction_window,
225  bool ppm,
226  double im_extraction_window,
227  const String& filter)
228  {
230  extraction_coordinates, mz_extraction_window, ppm, im_extraction_window, filter);
231  }
232 
233 public:
234 
256  static void prepare_coordinates(std::vector< OpenSwath::ChromatogramPtr > & output_chromatograms,
257  std::vector< ExtractionCoordinates > & coordinates,
258  const OpenMS::TargetedExperiment & transition_exp,
259  const double rt_extraction_window,
260  const bool ms1);
261 
262  static void prepare_coordinates(std::vector< OpenSwath::ChromatogramPtr > & output_chromatograms,
263  std::vector< ExtractionCoordinates > & coordinates,
264  const OpenSwath::LightTargetedExperiment & transition_exp_used,
265  const double rt_extraction_window,
266  const bool ms1);
267 
281  template <typename TransitionExpT>
282  static void return_chromatogram(const std::vector< OpenSwath::ChromatogramPtr > & chromatograms,
283  const std::vector< ChromatogramExtractor::ExtractionCoordinates > & coordinates,
284  TransitionExpT& transition_exp_used,
285  SpectrumSettings settings,
286  std::vector<OpenMS::MSChromatogram > & output_chromatograms,
287  bool ms1)
288  {
289  typedef std::map<String, const typename TransitionExpT::Transition* > TransitionMapType;
290  TransitionMapType trans_map;
291  for (Size i = 0; i < transition_exp_used.getTransitions().size(); i++)
292  {
293  trans_map[transition_exp_used.getTransitions()[i].getNativeID()] = &transition_exp_used.getTransitions()[i];
294  }
295 
296  for (Size i = 0; i < chromatograms.size(); i++)
297  {
298  const OpenSwath::ChromatogramPtr & chromptr = chromatograms[i];
299  const ChromatogramExtractor::ExtractionCoordinates & coord = coordinates[i];
300 
301  // copy data
304  chrom.setNativeID(coord.id);
305 
306  // Create precursor and set
307  // 1) the target m/z
308  // 2) the isolation window (upper/lower)
309  // 3) the peptide sequence
310  Precursor prec;
311  if (ms1)
312  {
313  prec.setMZ(coord.mz);
315 
316  // extract compound / peptide id from transition and store in
317  // more-or-less default field
318  int prec_charge = 0;
319  String r = extract_id_(transition_exp_used, coord.id, prec_charge);
320  prec.setCharge(prec_charge);
321  prec.setMetaValue("peptide_sequence", r);
322  }
323  else
324  {
325  typename TransitionExpT::Transition transition = (*trans_map[coord.id]);
326 
327  prec.setMZ(transition.getPrecursorMZ());
328  if (settings.getPrecursors().size() > 0)
329  {
330  prec.setIsolationWindowLowerOffset(settings.getPrecursors()[0].getIsolationWindowLowerOffset());
331  prec.setIsolationWindowUpperOffset(settings.getPrecursors()[0].getIsolationWindowUpperOffset());
332  }
333 
334  // Create product and set its m/z
335  Product prod;
336  prod.setMZ(transition.getProductMZ());
337  chrom.setProduct(prod);
339 
340  // extract compound / peptide id from transition and store in
341  // more-or-less default field
342  if (!transition.getPeptideRef().empty())
343  {
344  int prec_charge = 0;
345  String r = extract_id_(transition_exp_used, transition.getPeptideRef(), prec_charge);
346  prec.setCharge(prec_charge);
347  prec.setMetaValue("peptide_sequence", r);
348  }
349  else
350  {
351  int prec_charge = 0;
352  String r = extract_id_(transition_exp_used, transition.getCompoundRef(), prec_charge);
353  prec.setCharge(prec_charge);
354  prec.setMetaValue("peptide_sequence", r);
355  }
356  }
357  chrom.setPrecursor(prec);
358 
359  // Set the rest of the meta-data
361  chrom.setAcquisitionInfo(settings.getAcquisitionInfo());
362  chrom.setSourceFile(settings.getSourceFile());
363 
364  for (Size j = 0; j < settings.getDataProcessing().size(); ++j)
365  {
366  settings.getDataProcessing()[j]->setMetaValue("performed_on_spectra", "true");
367  chrom.getDataProcessing().push_back(settings.getDataProcessing()[j]);
368  }
369  output_chromatograms.push_back(chrom);
370  }
371  }
372 
374  template <typename SpectrumT>
375  void extract_value_tophat(const SpectrumT& input,
376  const double mz,
377  Size& peak_idx,
378  double& integrated_intensity,
379  const double extract_window,
380  const bool ppm)
381  {
382  integrated_intensity = 0;
383  if (input.size() == 0)
384  {
385  return;
386  }
387 
388  // calculate extraction window
389  double left, right;
390  if (ppm)
391  {
392  left = mz - mz * extract_window / 2.0 * 1.0e-6;
393  right = mz + mz * extract_window / 2.0 * 1.0e-6;
394  }
395  else
396  {
397  left = mz - extract_window / 2.0;
398  right = mz + extract_window / 2.0;
399  }
400 
401  Size walker;
402 
403  // advance the peak_idx until we hit the m/z value of the next transition
404  while (peak_idx < input.size() && input[peak_idx].getMZ() < mz)
405  {
406  peak_idx++;
407  }
408 
409  // walk right and left and add to our intensity
410  walker = peak_idx;
411  // if we moved past the end of the spectrum, we need to try the last peak
412  // of the spectrum (it could still be within the window)
413  if (peak_idx >= input.size())
414  {
415  walker = input.size() - 1;
416  }
417 
418  // add the current peak if it is between right and left
419  if (input[walker].getMZ() > left && input[walker].getMZ() < right)
420  {
421  integrated_intensity += input[walker].getIntensity();
422  }
423 
424  // (i) Walk to the left one step and then keep walking left until we go
425  // outside the window. Note for the first step to the left we have to
426  // check for the walker becoming zero.
427  walker = peak_idx;
428  if (walker > 0)
429  {
430  walker--;
431  // special case: walker is now zero
432  if (walker == 0 && input[walker].getMZ() > left && input[walker].getMZ() < right)
433  {
434  integrated_intensity += input[walker].getIntensity();
435  }
436  }
437  while (walker > 0 && input[walker].getMZ() > left && input[walker].getMZ() < right)
438  {
439  integrated_intensity += input[walker].getIntensity(); walker--;
440  }
441 
442  // (ii) Walk to the right one step and then keep walking right until we
443  // are outside the window
444  walker = peak_idx;
445  if (walker < input.size() )
446  {
447  walker++;
448  }
449  while (walker < input.size() && input[walker].getMZ() > left && input[walker].getMZ() < right)
450  {
451  integrated_intensity += input[walker].getIntensity(); walker++;
452  }
453  }
454 
456  template <typename SpectrumT>
457  void extract_value_bartlett(const SpectrumT& input,
458  const double mz,
459  Size& peak_idx,
460  double& integrated_intensity,
461  const double extract_window,
462  const bool ppm)
463  {
464  integrated_intensity = 0;
465  if (input.size() == 0)
466  {
467  return;
468  }
469 
470  // calculate extraction window
471  double left, right, half_window_size, weight;
472  if (ppm)
473  {
474  half_window_size = mz * extract_window / 2.0 * 1.0e-6;
475  left = mz - mz * extract_window / 2.0 * 1.0e-6;
476  right = mz + mz * extract_window / 2.0 * 1.0e-6;
477  }
478  else
479  {
480  half_window_size = extract_window / 2.0;
481  left = mz - extract_window / 2.0;
482  right = mz + extract_window / 2.0;
483  }
484 
485  Size walker;
486 
487  // advance the peak_idx until we hit the m/z value of the next transition
488  while (peak_idx < input.size() && input[peak_idx].getMZ() < mz)
489  {
490  peak_idx++;
491  }
492 
493  // walk right and left and add to our intensity
494  walker = peak_idx;
495  // if we moved past the end of the spectrum, we need to try the last peak
496  // of the spectrum (it could still be within the window)
497  if (peak_idx >= input.size())
498  {
499  walker = input.size() - 1;
500  }
501 
502  // add the current peak if it is between right and left
503  if (input[walker].getMZ() > left && input[walker].getMZ() < right)
504  {
505  weight = 1 - fabs(input[walker].getMZ() - mz) / half_window_size;
506  integrated_intensity += input[walker].getIntensity() * weight;
507  }
508 
509  // (i) Walk to the left one step and then keep walking left until we go
510  // outside the window. Note for the first step to the left we have to
511  // check for the walker becoming zero.
512  walker = peak_idx;
513  if (walker > 0)
514  {
515  walker--;
516  // special case: walker is now zero
517  if (walker == 0 && input[walker].getMZ() > left && input[walker].getMZ() < right)
518  {
519  integrated_intensity += input[walker].getIntensity();
520  }
521  }
522  while (walker > 0 && input[walker].getMZ() > left && input[walker].getMZ() < right)
523  {
524  weight = 1 - fabs(input[walker].getMZ() - mz) / half_window_size;
525  integrated_intensity += input[walker].getIntensity() * weight; walker--;
526  }
527 
528  // (ii) Walk to the right one step and then keep walking right until we
529  // are outside the window
530  walker = peak_idx;
531  if (walker < input.size() )
532  {
533  walker++;
534  }
535  while (walker<input.size() && input[walker].getMZ()> left && input[walker].getMZ() < right)
536  {
537  weight = 1 - fabs(input[walker].getMZ() - mz) / half_window_size;
538  integrated_intensity += input[walker].getIntensity() * weight; walker++;
539  }
540  }
541 
542 private:
543 
552  template <typename TransitionExpT>
553  static String extract_id_(TransitionExpT& transition_exp_used, const String& id, int& prec_charge);
554 
569  template <class SpectrumSettingsT, class ChromatogramT>
570  void prepareSpectra_(SpectrumSettingsT& settings,
571  std::vector<ChromatogramT>& chromatograms,
572  OpenMS::TargetedExperiment& transition_exp)
573  {
574  // first prepare all the spectra (but leave them empty)
575  for (Size i = 0; i < transition_exp.getTransitions().size(); i++)
576  {
577  const ReactionMonitoringTransition* transition = &transition_exp.getTransitions()[i];
578 
579  // 1) and 2) Extract precursor m/z and isolation window
580  ChromatogramT chrom;
581  Precursor prec;
582  prec.setMZ(transition->getPrecursorMZ());
583  if (settings.getPrecursors().size() > 0)
584  {
585  prec.setIsolationWindowLowerOffset(settings.getPrecursors()[0].getIsolationWindowLowerOffset());
586  prec.setIsolationWindowUpperOffset(settings.getPrecursors()[0].getIsolationWindowUpperOffset());
587  }
588 
589  // 3) set precursor peptide sequence / compound id in more-or-less default field
590  String pepref = transition->getPeptideRef();
591  for (Size pep_idx = 0; pep_idx < transition_exp.getPeptides().size(); pep_idx++)
592  {
593  const OpenMS::TargetedExperiment::Peptide* pep = &transition_exp.getPeptides()[pep_idx];
594  if (pep->id == pepref)
595  {
596  prec.setMetaValue("peptide_sequence", pep->sequence);
597  break;
598  }
599  }
600  String compref = transition->getCompoundRef();
601  for (Size comp_idx = 0; comp_idx < transition_exp.getCompounds().size(); comp_idx++)
602  {
603  const OpenMS::TargetedExperiment::Compound* comp = &transition_exp.getCompounds()[comp_idx];
604  if (comp->id == compref)
605  {
606  prec.setMetaValue("peptide_sequence", String(comp->id) );
607  break;
608  }
609  }
610 
611  // add precursor to spectrum
612  chrom.setPrecursor(prec);
613 
614  // 4) Create product and set its m/z
615  Product prod;
616  prod.setMZ(transition->getProductMZ());
617  chrom.setProduct(prod);
618 
619  // 5) Set the rest of the meta-data
620  chrom.setInstrumentSettings(settings.getInstrumentSettings());
621  chrom.setAcquisitionInfo(settings.getAcquisitionInfo());
622  chrom.setSourceFile(settings.getSourceFile());
623 
624  for (Size j = 0; j < settings.getDataProcessing().size(); ++j)
625  {
626  settings.getDataProcessing()[j]->setMetaValue("performed_on_spectra", "true");
627  chrom.getDataProcessing().push_back(settings.getDataProcessing()[j]);
628  }
629 
630  // Set the id of the chromatogram, using the id of the transition (this gives directly the mapping of the two)
631  chrom.setNativeID(transition->getNativeID());
633  chromatograms.push_back(chrom);
634  }
635 
636  }
637 
639  bool outsideExtractionWindow_(const ReactionMonitoringTransition& transition,
640  double current_rt,
641  const TransformationDescription& trafo,
642  double rt_extraction_window);
643 
645  int getFilterNr_(const String& filter);
646 
648  void populatePeptideRTMap_(OpenMS::TargetedExperiment& transition_exp,
649  double rt_extraction_window);
650 
651  std::map<OpenMS::String, double> PeptideRTMap_;
652 
653  };
654 
655  // Specialization for template (LightTargetedExperiment)
656  template<>
657  inline String ChromatogramExtractor::extract_id_<OpenSwath::LightTargetedExperiment>(OpenSwath::LightTargetedExperiment& transition_exp_used,
658  const String& id,
659  int & prec_charge)
660  {
661  const OpenSwath::LightCompound comp = transition_exp_used.getCompoundByRef(id);
662  prec_charge = comp.charge;
663  if (!comp.sequence.empty())
664  {
665  return comp.sequence;
666  }
667  else
668  {
669  return comp.compound_name;
670  }
671  }
672 
673 
674  // Specialization for template (TargetedExperiment)
675  template<>
676  inline String ChromatogramExtractor::extract_id_<OpenMS::TargetedExperiment>(OpenMS::TargetedExperiment& transition_exp_used,
677  const String& id,
678  int & prec_charge)
679  {
680  if (transition_exp_used.hasPeptide(id))
681  {
682  const TargetedExperiment::Peptide p = transition_exp_used.getPeptideByRef(id);
683  if (p.hasCharge()) {prec_charge = p.getChargeState();}
684  return p.sequence;
685  }
686  else if (transition_exp_used.hasCompound(id))
687  {
688  const TargetedExperiment::Compound c = transition_exp_used.getCompoundByRef(id);
689  if (c.hasCharge()) {prec_charge = c.getChargeState();}
690  return c.id;
691  }
692  else
693  {
694  return "";
695  }
696  }
697 }
698 
const double k
std::map< OpenMS::String, double > PeptideRTMap_
Definition: ChromatogramExtractor.h:651
void setMetaValue(const String &name, const DataValue &value)
Sets the DataValue corresponding to a name.
A more convenient string class.
Definition: String.h:57
Precursor meta information.
Definition: Precursor.h:57
The ChromatogramExtractorAlgorithm extracts chromatograms from a MS data.
Definition: ChromatogramExtractorAlgorithm.h:58
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)
This converts the ChromatogramPtr to MSChromatogram and adds meta-information.
Definition: ChromatogramExtractor.h:282
Product meta information.
Definition: Product.h:48
boost::shared_ptr< ISpectrumAccess > SpectrumAccessPtr
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:89
The representation of a chromatogram.
Definition: MSChromatogram.h:54
void setChromatogramType(ChromatogramType type)
sets the chromatogram type
void setProduct(const Product &product)
sets the products
Peak2D PeakType
Definition: MassTrace.h:47
const InstrumentSettings & getInstrumentSettings() const
returns a const reference to the instrument settings of the current spectrum
const String & getCompoundRef() const
Representation of 1D spectrum settings.
Definition: SpectrumSettings.h:63
void setMZ(double mz)
sets the target m/z
void setSourceFile(const SourceFile &source_file)
sets the source file
const double c
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
Definition: ChromatogramExtractorAlgorithm.h:64
void setMZ(CoordinateType mz)
Mutable access to m/z.
Definition: Peak1D.h:119
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:192
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:221
Definition: ChromatogramSettings.h:71
const SourceFile & getSourceFile() const
returns a const reference to the source file
void sortTransitionsByProductMZ()
Lexicographically sorts the transitions by their product m/z.
void setInstrumentSettings(const InstrumentSettings &instrument_settings)
sets the instrument settings of the current spectrum
ChromatogramExtractorAlgorithm::ExtractionCoordinates ExtractionCoordinates
Definition: ChromatogramExtractor.h:72
void setIsolationWindowLowerOffset(double bound)
sets the lower offset from the target m/z
const AcquisitionInfo & getAcquisitionInfo() const
returns a const reference to the acquisition info
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:457
std::vector< DataProcessingPtr > & getDataProcessing()
returns a mutable reference to the description of the applied processing
const std::vector< ReactionMonitoringTransition > & getTransitions() const
returns the transition list
double mz
m/z value around which should be extracted
Definition: ChromatogramExtractorAlgorithm.h:66
void setNativeID(const String &native_id)
sets the native identifier for the spectrum, used by the acquisition software.
boost::shared_ptr< Chromatogram > ChromatogramPtr
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:170
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:95
void setIsolationWindowUpperOffset(double bound)
sets the upper offset from the target m/z
bool hasCharge() const
Whether peptide or compound has set charge state.
Definition: TargetedExperimentHelper.h:314
void setAcquisitionInfo(const AcquisitionInfo &acquisition_info)
sets the acquisition info
Definition: TransitionExperiment.h:149
std::string sequence
Definition: TransitionExperiment.h:161
Represents a compound (small molecule)
Definition: TargetedExperimentHelper.h:399
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:375
std::vector< DataProcessingPtr > & getDataProcessing()
returns a mutable reference to the description of the applied processing
String id
Definition: TargetedExperimentHelper.h:383
The ChromatogramExtractor extracts chromatograms from a spectra file.
Definition: ChromatogramExtractor.h:66
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.
double getPrecursorMZ() const
get the precursor mz (Q1 value)
const std::vector< Precursor > & getPrecursors() const
returns a const reference to the precursors
int getChargeState() const
Return the peptide or compound charge state.
Definition: TargetedExperimentHelper.h:320
const String & getPeptideRef() const
String sequence
Definition: TargetedExperimentHelper.h:537
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:570
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
const std::vector< Compound > & getCompounds() const
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:54
A description of a targeted experiment containing precursor and production ions.
Definition: TargetedExperiment.h:64
void setCharge(Int charge)
Mutable access to the charge.
Generic description of a coordinate transformation.
Definition: TransformationDescription.h:60
const std::vector< Peptide > & getPeptides() const
static void convertToOpenMSChromatogram(const OpenSwath::ChromatogramPtr cptr, OpenMS::MSChromatogram &chromatogram)
Convert a ChromatogramPtr to an OpenMS Chromatogram.
std::string compound_name
Definition: TransitionExperiment.h:169
const String & getNativeID() const
int charge
Definition: TransitionExperiment.h:160
void setPrecursor(const Precursor &precursor)
sets the precursors
Definition: TransitionExperiment.h:206
std::string id
identifier
Definition: ChromatogramExtractorAlgorithm.h:71
void invert()
Computes an (approximate) inverse of the transformation.
Represents a peptide (amino acid sequence)
Definition: TargetedExperimentHelper.h:451
This class stores a SRM/MRM transition.
Definition: ReactionMonitoringTransition.h:56