OpenMS
TIC.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-2023.
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: Chris Bielow $
32 // $Authors: Tom Waschischeck $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
37 #include <OpenMS/QC/QCBase.h>
38 
49 namespace OpenMS
50 {
51  class MzTabMetaData;
52  class MSExperiment;
53  class MSChromatogram;
54 
55  class OPENMS_DLLAPI TIC : public QCBase
56  {
57  public:
59  TIC() = default;
60 
62  virtual ~TIC() = default;
63 
64  // stores TIC values calculated by compute function
65  struct OPENMS_DLLAPI Result {
66  std::vector<UInt> intensities; // TIC intensities
67  std::vector<float> relative_intensities;
68  std::vector<float> retention_times; // TIC RTs in seconds
69  UInt area = 0; // Area under TIC
70  UInt fall = 0; // MS1 signal fall (10x) count
71  UInt jump = 0; // MS1 signal jump (10x) count
72 
73  bool operator==(const Result& rhs) const;
74  };
75 
76 
88  Result compute(const MSExperiment& exp, float bin_size = 0, UInt ms_level = 1);
89 
90  const String& getName() const override;
91 
92  const std::vector<MSChromatogram>& getResults() const;
93 
94  QCBase::Status requirements() const override;
95 
97  void addMetaDataMetricsToMzTab(MzTabMetaData& meta, std::vector<Result>& tics);
98 
99  private:
100  const String name_ = "TIC";
101  };
102 } // namespace OpenMS
Stores and handles combinations of enum values, e.g. a set of flags as bits flipped in an UInt64.
Definition: FlagSet.h:54
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:72
all meta data of a mzTab file. Please refer to specification for documentation.
Definition: MzTab.h:141
This class serves as an abstract base class for all QC classes.
Definition: QCBase.h:55
A more convenient string class.
Definition: String.h:60
Definition: TIC.h:56
virtual ~TIC()=default
Destructor.
Result compute(const MSExperiment &exp, float bin_size=0, UInt ms_level=1)
Compute Total Ion Count and applies the resampling algorithm, if a bin size in RT seconds greater tha...
const String & getName() const override
Returns the name of the metric.
TIC()=default
Constructor.
const std::vector< MSChromatogram > & getResults() const
QCBase::Status requirements() const override
Returns the input data requirements of the compute(...) function.
void addMetaDataMetricsToMzTab(MzTabMetaData &meta, std::vector< Result > &tics)
append QC data for given metrics to mzTab's MTD section
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:48
Definition: TIC.h:65
bool operator==(const Result &rhs) const
std::vector< float > relative_intensities
Definition: TIC.h:67
std::vector< UInt > intensities
Definition: TIC.h:66
std::vector< float > retention_times
Definition: TIC.h:68