OpenMS  2.6.0
MetaboTargetedAssay.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-2020.
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: Oliver Alka $
32 // $Authors: Oliver Alka $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
38 #include <map> //insert
39 
42 #include <OpenMS/ANALYSIS/ID/SiriusMSConverter.h> //SiriusMSFile
43 #include <OpenMS/FORMAT/DATAACCESS/SiriusFragmentAnnotation.h> //SiriusTargetDecoySpectra
44 
46 
47 namespace OpenMS
48 {
54  class OPENMS_DLLAPI MetaboTargetedAssay
55  {
56  public:
57 
63  double precursor_int;
68  std::vector<ReactionMonitoringTransition> potential_rmts;
69 
75  {
78 
79  CompoundTargetDecoyPair() = default;
80  CompoundTargetDecoyPair(SiriusMSFile::CompoundInfo info, SiriusFragmentAnnotation::SiriusTargetDecoySpectra td_spectra) : compound_info(info), target_decoy_spectra(td_spectra) {}
81  };
82 
83 
103  static std::vector<MetaboTargetedAssay> extractMetaboTargetedAssay(const MSExperiment& spectra,
104  const FeatureMapping::FeatureToMs2Indices& feature_ms2_index,
105  const double& precursor_rt_tol,
106  const double& precursor_mz_distance,
107  const double& cosine_sim_threshold,
108  const double& transition_threshold,
109  const double& min_fragment_mz,
110  const double& max_fragment_mz,
111  const bool& method_consensus_spectrum,
112  const bool& exclude_ms2_precursor,
113  const unsigned int& file_counter);
114 
131  static std::vector<MetaboTargetedAssay> extractMetaboTargetedAssayFragmentAnnotation(const std::vector< CompoundTargetDecoyPair >& v_cmp_spec,
132  const double& transition_threshold,
133  const double& min_fragment_mz,
134  const double& max_fragment_mz,
135  const bool& use_exact_mass,
136  const bool& exclude_ms2_precursor,
137  const unsigned int& file_counter);
138 
139 
140 
141 
151  static std::vector< MetaboTargetedAssay::CompoundTargetDecoyPair > pairCompoundWithAnnotatedSpectra(const std::vector<SiriusMSFile::CompoundInfo>& v_cmpinfo,
152  const std::vector<SiriusFragmentAnnotation::SiriusTargetDecoySpectra>& annotated_spectra);
153 
154 
155  protected:
156 
161  static bool intensityLess_(Peak1D a, Peak1D b);
162 
166  static int getChargeFromAdduct_(const String& adduct);
167 
168 };
169 
170 } // namespace OpenMS
TargetedExperiment.h
OpenMS::String
A more convenient string class.
Definition: String.h:59
OpenMS::MetaboTargetedAssay::transition_quality_score
double transition_quality_score
Definition: MetaboTargetedAssay.h:64
OpenMS::MSExperiment
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:77
OpenMS::MetaboTargetedAssay::CompoundTargetDecoyPair::target_decoy_spectra
SiriusFragmentAnnotation::SiriusTargetDecoySpectra target_decoy_spectra
Definition: MetaboTargetedAssay.h:77
OpenMS::MetaboTargetedAssay::potential_rmts
std::vector< ReactionMonitoringTransition > potential_rmts
Definition: MetaboTargetedAssay.h:68
OpenMS::MetaboTargetedAssay::CompoundTargetDecoyPair::compound_info
SiriusMSFile::CompoundInfo compound_info
Definition: MetaboTargetedAssay.h:76
ReactionMonitoringTransition.h
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
Exception.h
OpenMS::MetaboTargetedAssay
This class provides methods for the extraction of targeted assays for metabolomics.
Definition: MetaboTargetedAssay.h:54
SiriusMSConverter.h
OpenMS::MetaboTargetedAssay::potential_cmp
TargetedExperiment::Compound potential_cmp
Definition: MetaboTargetedAssay.h:67
OpenMS::SiriusFragmentAnnotation::SiriusTargetDecoySpectra
SiriusTargetDecoySpectra holds the target and/or decoy information for one entry (subdirectory from S...
Definition: SiriusFragmentAnnotation.h:48
OpenMS::TargetedExperimentHelper::Compound
Represents a compound (small molecule)
Definition: TargetedExperimentHelper.h:321
OpenMS::MetaboTargetedAssay::compound_adduct
String compound_adduct
Definition: MetaboTargetedAssay.h:66
OpenMS::MetaboTargetedAssay::CompoundTargetDecoyPair::CompoundTargetDecoyPair
CompoundTargetDecoyPair(SiriusMSFile::CompoundInfo info, SiriusFragmentAnnotation::SiriusTargetDecoySpectra td_spectra)
Definition: MetaboTargetedAssay.h:80
OpenMS::Peak1D
A 1-dimensional raw data point or peak.
Definition: Peak1D.h:54
SiriusFragmentAnnotation.h
OpenMS::FeatureMapping::FeatureToMs2Indices
Definition: FeatureMapping.h:48
OpenMS::SiriusMSFile::CompoundInfo
Definition: SiriusMSConverter.h:61
OpenMS::MetaboTargetedAssay::precursor_int
double precursor_int
MetaboTargetedAssay is able to store a precursor and its metadata as well as a reference to a compoun...
Definition: MetaboTargetedAssay.h:63
StandardTypes.h
OpenMS::MetaboTargetedAssay::compound_name
String compound_name
Definition: MetaboTargetedAssay.h:65
OpenMS::MetaboTargetedAssay::CompoundTargetDecoyPair
CompoundTargetDecoyPair stores a pair of CompoundInfo and MSSpectrum (target, decoy)
Definition: MetaboTargetedAssay.h:74