OpenMS  3.0.0
OpenSwathScores.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-2022.
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 
37 #include <OpenMS/OpenMSConfig.h>
38 #include <OpenMS/CONCEPT/Types.h>
39 
41 #include <vector>
42 
43 namespace OpenMS
44 {
45 
50  struct OPENMS_DLLAPI OpenSwath_Scores_Usage
51  {
52  bool use_coelution_score_ = true;
53  bool use_shape_score_ = true;
54  bool use_rt_score_ = true;
55  bool use_library_score_ = true;
56  bool use_elution_model_score_ = true;
57  bool use_intensity_score_ = true;
58  bool use_total_xic_score_ = true;
59  bool use_total_mi_score_ = true;
60  bool use_nr_peaks_score_ = true;
61  bool use_sn_score_ = true;
62  bool use_mi_score_ = true;
63  bool use_dia_scores_ = true;
64  bool use_sonar_scores = true;
65  bool use_im_scores = true;
66  bool use_ms1_correlation = true;
67  bool use_ms1_fullscan = true;
68  bool use_ms1_mi = true;
69  bool use_uis_scores = true;
70  bool use_ionseries_scores = true;
71  bool use_ms2_isotope_scores = true;
72  };
73 
82  struct OPENMS_DLLAPI OpenSwath_Scores
83  {
84  double elution_model_fit_score = 0;
85  double library_corr = 0;
86  double library_norm_manhattan = 0;
87  double library_rootmeansquare = 0;
88  double library_sangle = 0;
89  double norm_rt_score = 0;
90 
91  double isotope_correlation = 0;
92  double isotope_overlap = 0;
93  double massdev_score = 0;
94  double xcorr_coelution_score = 0;
95  double xcorr_shape_score = 0;
96 
97  double yseries_score = 0;
98  double bseries_score = 0;
99  double log_sn_score = 0;
100 
101  double weighted_coelution_score = 0;
102  double weighted_xcorr_shape = 0;
103  double weighted_massdev_score = 0;
104 
105  double ms1_xcorr_coelution_score = -1;
106  double ms1_xcorr_coelution_contrast_score = 0;
107  double ms1_xcorr_coelution_combined_score = 0;
108  double ms1_xcorr_shape_score = -1;
109  double ms1_xcorr_shape_contrast_score = 0;
110  double ms1_xcorr_shape_combined_score = 0;
111  double ms1_ppm_score = 0;
112  double ms1_isotope_correlation = 0;
113  double ms1_isotope_overlap = 0;
114  double ms1_mi_score = -1;
115  double ms1_mi_contrast_score = 0;
116  double ms1_mi_combined_score = 0;
117 
118  double sonar_sn = 0;
119  double sonar_diff = 0;
120  double sonar_trend = 0;
121  double sonar_rsq = 0;
122  double sonar_shape = 0;
123  double sonar_lag = 0;
124 
125  double im_xcorr_coelution_score = 0;
126  double im_xcorr_shape_score = 0;
127  double im_delta_score = 0;
128  double im_ms1_delta_score = 0;
129  double im_drift = 0;
130  double im_drift_weighted = 0;
131  double im_ms1_contrast_coelution = 0;
132  double im_ms1_contrast_shape = 0;
133  double im_ms1_sum_contrast_coelution = 0;
134  double im_ms1_sum_contrast_shape = 0;
135 
136  double library_manhattan = 0;
137  double library_dotprod = 0;
138  double intensity = 0;
139  double total_xic = 0;
140  double nr_peaks = 0;
141  double sn_ratio = 0;
142  double mi_score = 0;
143  double weighted_mi_score = 0;
144 
145  double rt_difference = 0;
146  double normalized_experimental_rt = 0;
147  double raw_rt_score = 0;
148 
149  double dotprod_score_dia = 0;
150  double manhatt_score_dia = 0;
151 
152  OpenSwath_Scores() = default;
153 
154  double get_quick_lda_score(double library_corr_,
155  double library_norm_manhattan_,
156  double norm_rt_score_,
157  double xcorr_coelution_score_,
158  double xcorr_shape_score_,
159  double log_sn_score_) const;
160 
171  double calculate_lda_prescore(const OpenSwath_Scores& scores) const;
172 
181  double calculate_lda_single_transition(const OpenSwath_Scores& scores) const;
182 
190  double calculate_swath_lda_prescore(const OpenSwath_Scores& scores) const;
191 
192  };
193 
194  struct OPENMS_DLLAPI OpenSwath_Ind_Scores
195  {
196  int ind_num_transitions = 0;
197  std::vector<OpenMS::String> ind_transition_names;
198  std::vector<double> ind_isotope_correlation;
199  std::vector<double> ind_isotope_overlap;
200  std::vector<double> ind_massdev_score;
201  std::vector<double> ind_xcorr_coelution_score;
202  std::vector<double> ind_xcorr_shape_score;
203  std::vector<double> ind_log_sn_score;
204  std::vector<double> ind_area_intensity;
205  std::vector<double> ind_total_area_intensity;
206  std::vector<double> ind_intensity_score;
207  std::vector<double> ind_apex_intensity;
208  std::vector<double> ind_total_mi;
209  std::vector<double> ind_log_intensity;
210  std::vector<double> ind_intensity_ratio;
211  std::vector<double> ind_mi_ratio;
212  std::vector<double> ind_mi_score;
213 
214  OpenSwath_Ind_Scores() = default;
215 
216  };
217 
218 }
219 
220 
OpenMS::OpenSwath_Ind_Scores::ind_transition_names
std::vector< OpenMS::String > ind_transition_names
Definition: OpenSwathScores.h:197
OpenMS::UniqueIdInterface::ensureUniqueId
Size ensureUniqueId()
Assigns a valid unique id, but only if the present one is invalid. Returns 1 if the unique id was cha...
OpenMS::TOPPBase
Base class for TOPP applications.
Definition: TOPPBase.h:147
OpenMS::OpenSwath_Ind_Scores::ind_total_area_intensity
std::vector< double > ind_total_area_intensity
Definition: OpenSwathScores.h:205
MapType
PeakMap MapType
Definition: PeakPickerIterative.cpp:84
Size
OpenMS::Param::setValue
void setValue(const std::string &key, const ParamValue &value, const std::string &description="", const std::vector< std::string > &tags=std::vector< std::string >())
Sets a value.
OpenMS::Exception::IllegalArgument
A method or algorithm argument contains illegal values.
Definition: Exception.h:648
Types.h
OpenMS::OpenSwath_Ind_Scores::ind_total_mi
std::vector< double > ind_total_mi
Definition: OpenSwathScores.h:208
OpenMS::MRMFeatureFinderScoring
The MRMFeatureFinder finds and scores peaks of transitions that co-elute.
Definition: MRMFeatureFinderScoring.h:89
OpenMS::Constants::k
const double k
Definition: Constants.h:153
OpenMS::MetaInfoInterface::getMetaValue
const DataValue & getMetaValue(const String &name, const DataValue &default_value=DataValue::EMPTY) const
Returns the value corresponding to a string, or a default value (default: DataValue::EMPTY) if not fo...
OpenMS::MzMLFile
File adapter for MzML files.
Definition: MzMLFile.h:57
OpenMS::String
A more convenient string class.
Definition: String.h:58
MzMLFile.h
Feature.h
OpenMS::MSExperiment
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:70
SimpleOpenMSSpectraAccessFactory.h
FeatureXMLFile.h
OpenMS::TraMLFile::load
void load(const String &filename, TargetedExperiment &id)
Loads a map from a TraML file.
OpenMS::OpenSwath_Ind_Scores::ind_intensity_score
std::vector< double > ind_intensity_score
Definition: OpenSwathScores.h:206
OpenMS::OpenSwath_Ind_Scores
Definition: OpenSwathScores.h:194
OpenMS::OpenSwath_Ind_Scores::ind_xcorr_shape_score
std::vector< double > ind_xcorr_shape_score
Definition: OpenSwathScores.h:202
OpenSwath::LightTargetedExperiment
Definition: TransitionExperiment.h:218
OpenMS::ParamValue::toBool
bool toBool() const
Conversion to bool.
OpenMS::OpenSwath_Ind_Scores::ind_massdev_score
std::vector< double > ind_massdev_score
Definition: OpenSwathScores.h:200
OpenMS::MRMRTNormalizer::computeBinnedCoverage
static bool computeBinnedCoverage(const std::pair< double, double > &rtRange, const std::vector< std::pair< double, double > > &pairs, int nrBins, int minPeptidesPerBin, int minBinsFilled)
Computes coverage of the RT normalization peptides over the whole RT range, ensuring that each bin ha...
OpenMS::MRMFeatureFinderScoring::TransitionGroupMapType
std::map< String, MRMTransitionGroupType > TransitionGroupMapType
Definition: MRMFeatureFinderScoring.h:105
OpenMS::TransformationDescription::fitModel
void fitModel(const String &model_type, const Param &params=Param())
Fits a model to the data.
OpenMS::OpenSwathDataAccessHelper::convertTargetedExp
static void convertTargetedExp(const OpenMS::TargetedExperiment &transition_exp_, OpenSwath::LightTargetedExperiment &transition_exp)
convert from the OpenMS TargetedExperiment to the LightTargetedExperiment
OpenSwathHelper.h
OpenMS::MRMFeatureFinderScoring::pickExperiment
void pickExperiment(const PeakMap &chromatograms, FeatureMap &output, const TargetedExperiment &transition_exp, const TransformationDescription &trafo, const PeakMap &swath_map)
Picker and prepare functions.
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
OpenMS::TraMLFile
File adapter for HUPO PSI TraML files.
Definition: TraMLFile.h:63
OpenSwath::LightTargetedExperiment::getCompounds
std::vector< LightCompound > & getCompounds()
Definition: TransitionExperiment.h:240
MRMRTNormalizer.h
OpenMS::OpenSwath_Ind_Scores::ind_isotope_correlation
std::vector< double > ind_isotope_correlation
Definition: OpenSwathScores.h:198
OpenMS::ProgressLogger
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:52
OpenMS::TransformationDescription::setDataPoints
void setDataPoints(const DataPoints &data)
Sets the data points.
OpenMS::MetaInfoInterface::setMetaValue
void setMetaValue(const String &name, const DataValue &value)
Sets the DataValue corresponding to a name.
OpenMS::MRMRTNormalizer::removeOutliersRANSAC
static std::vector< std::pair< double, double > > removeOutliersRANSAC(const std::vector< std::pair< double, double > > &pairs, double rsq_limit, double coverage_limit, size_t max_iterations, double max_rt_threshold, size_t sampling_size)
This function removes potential outliers in a linear regression dataset.
ProgressLogger.h
OpenMS::MzMLFile::load
void load(const String &filename, PeakMap &map)
Loads a map from a MzML file. Spectra and chromatograms are sorted by default (this can be disabled u...
OpenMS::MRMRTNormalizer::removeOutliersIterative
static std::vector< std::pair< double, double > > removeOutliersIterative(const std::vector< std::pair< double, double > > &pairs, double rsq_limit, double coverage_limit, bool use_chauvenet, const std::string &method)
This function removes potential outliers in a linear regression dataset.
MRMFeatureFinderScoring.h
TransformationXMLFile.h
OpenMS::FeatureXMLFile::load
void load(const String &filename, FeatureMap &feature_map)
loads the file with name filename into map and calls updateRanges().
FeatureMap.h
OpenMS::OpenSwath_Ind_Scores::ind_mi_score
std::vector< double > ind_mi_score
Definition: OpenSwathScores.h:212
OpenMS::MRMFeatureFinderScoring::setStrictFlag
void setStrictFlag(bool f)
Set the flag for strict mapping.
Definition: MRMFeatureFinderScoring.h:193
OpenMS::DefaultParamHandler::setParameters
void setParameters(const Param &param)
Sets the parameters.
OpenMS::FeatureMap::applyMemberFunction
Size applyMemberFunction(Size(Type::*member_function)())
Applies a member function of Type to the container itself and all features (including subordinates)....
Definition: FeatureMap.h:289
OpenMS::DefaultParamHandler::getDefaults
const Param & getDefaults() const
Non-mutable access to the default parameters.
OpenMS::SimpleOpenMSSpectraFactory::getSpectrumAccessOpenMSPtr
static OpenSwath::SpectrumAccessPtr getSpectrumAccessOpenMSPtr(boost::shared_ptr< OpenMS::PeakMap > exp)
Simple Factory method to get a SpectrumAccess Ptr from an MSExperiment.
OpenMS::OpenSwath_Ind_Scores::ind_xcorr_coelution_score
std::vector< double > ind_xcorr_coelution_score
Definition: OpenSwathScores.h:201
OpenMS::StringList
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:70
OpenMS::FeatureXMLFile::store
void store(const String &filename, const FeatureMap &feature_map)
stores the map feature_map in file with name filename.
OpenMS::OpenSwathHelper::estimateRTRange
static std::pair< double, double > estimateRTRange(const OpenSwath::LightTargetedExperiment &exp)
Computes the min and max retention time value.
OpenMS::MSExperiment::addChromatogram
void addChromatogram(const MSChromatogram &chromatogram)
adds a chromatogram to the list
OpenMS::OpenSwath_Ind_Scores::ind_log_intensity
std::vector< double > ind_log_intensity
Definition: OpenSwathScores.h:209
OpenMS::ParamValue::toString
std::string toString(bool full_precision=true) const
Convert ParamValue to string.
main
int main(int argc, const char **argv)
Definition: INIFileEditor.cpp:71
DataAccessHelper.h
OpenMS::TransformationXMLFile::load
void load(const String &filename, TransformationDescription &transformation, bool fit_model=true)
Loads the transformation from an TransformationXML file.
OpenMS::FeatureMap
A container for features.
Definition: FeatureMap.h:98
OpenMS::TransformationXMLFile
Used to load and store TransformationXML files.
Definition: TransformationXMLFile.h:56
OpenMS::Feature
An LC-MS feature.
Definition: Feature.h:70
OpenMS::Param::copy
Param copy(const std::string &prefix, bool remove_prefix=false) const
Returns a new Param object containing all entries that start with prefix.
OpenSwath::SpectrumAccessPtr
boost::shared_ptr< ISpectrumAccess > SpectrumAccessPtr
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:87
OpenMS::FeatureXMLFile
This class provides Input/Output functionality for feature maps.
Definition: FeatureXMLFile.h:62
String.h
OpenMS::OpenSwath_Scores
A structure to hold the different scores computed by OpenSWATH.
Definition: OpenSwathScores.h:82
OpenMS::OpenSwath_Ind_Scores::ind_log_sn_score
std::vector< double > ind_log_sn_score
Definition: OpenSwathScores.h:203
OpenMS::Param
Management and storage of parameters / INI files.
Definition: Param.h:69
OpenMS::TransformationXMLFile::store
void store(String filename, const TransformationDescription &transformation)
Stores the data in an TransformationXML file.
OpenMS::TargetedExperiment
A description of a targeted experiment containing precursor and production ions.
Definition: TargetedExperiment.h:64
OpenMS::OpenSwath_Ind_Scores::ind_isotope_overlap
std::vector< double > ind_isotope_overlap
Definition: OpenSwathScores.h:199
OpenMS::OpenSwath_Ind_Scores::ind_intensity_ratio
std::vector< double > ind_intensity_ratio
Definition: OpenSwathScores.h:210
OpenMS::Param::getValue
const ParamValue & getValue(const std::string &key) const
Returns a value of a parameter.
TraMLFile.h
OpenMS::TransformationDescription
Generic description of a coordinate transformation.
Definition: TransformationDescription.h:62
OpenMS::Param::setValidStrings
void setValidStrings(const std::string &key, const std::vector< std::string > &strings)
Sets the valid strings for the parameter key.
OpenMS::UniqueIdInterface::getUniqueId
UInt64 getUniqueId() const
Non-mutable access to unique id - returns the unique id.
Definition: UniqueIdInterface.h:104
OpenMS::ProgressLogger::setLogType
void setLogType(LogType type) const
Sets the progress log that should be used. The default type is NONE!
OpenMS::OpenSwath_Ind_Scores::ind_mi_ratio
std::vector< double > ind_mi_ratio
Definition: OpenSwathScores.h:211
TOPPBase.h
OpenMS::OpenSwath_Scores_Usage
A structure to store which scores should be used by the OpenSWATH Algorithm.
Definition: OpenSwathScores.h:50
OpenMS::FeatureMap::clear
void clear(bool clear_meta_data=true)
Clears all data and meta data.
OpenMS::OpenSwath_Ind_Scores::ind_apex_intensity
std::vector< double > ind_apex_intensity
Definition: OpenSwathScores.h:207
OpenMS::OpenSwath_Ind_Scores::ind_area_intensity
std::vector< double > ind_area_intensity
Definition: OpenSwathScores.h:204
OpenMS::OpenSwathHelper::simpleFindBestFeature
static std::map< std::string, double > simpleFindBestFeature(const OpenMS::MRMFeatureFinderScoring::TransitionGroupMapType &transition_group_map, bool useQualCutoff=false, double qualCutoff=0.0)
Returns the feature with the highest score for each transition group.