OpenMS
Loading...
Searching...
No Matches
OpenSwathScoring.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- 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
11// data access
17
18// Kernel classes
21
22// scoring
25
26#include <vector>
27#include <memory>
28
29//logging
31
32struct RangeMZ;
33struct RangeMobility;
34
35namespace OpenMS
36{
42 class MobilogramParquetConsumer;
43
44 class OPENMS_DLLAPI OpenSwathScoring
45 {
49
51 {
52 ADDITION,
53 RESAMPLE
54 };
55
57 {
58 FIXED,
59 DYNAMIC
60 };
61
72
73 public:
74
84 enum class ScoreSubset
85 {
86 ALL,
87 RANKING,
88 REMAINDER
89 };
90
93
96
113 void initialize(double rt_normalization_factor,
114 int add_up_spectra,
115 double spacing_for_spectra_resampling,
116 double merge_spectra_by_peak_width_fraction,
117 const double drift_extra,
118 const OpenSwath_Scores_Usage & su,
119 const std::string& spectrum_addition_method,
120 const std::string& spectrum_merge_method_type,
121 bool use_ms1_ion_mobility,
122 bool apply_im_peak_picking);
123
144 const std::vector<std::string>& native_ids,
145 const std::vector<std::string>& precursor_ids,
146 const std::vector<double>& normalized_library_intensity,
147 std::vector<OpenSwath::ISignalToNoisePtr>& signal_noise_estimators,
148 OpenSwath_Scores & scores,
149 ScoreSubset subset = ScoreSubset::ALL) const;
150
170 const std::vector<std::string>& native_ids_identification,
171 const std::vector<std::string>& native_ids_detection,
172 std::vector<OpenSwath::ISignalToNoisePtr>& signal_noise_estimators,
173 OpenSwath_Ind_Scores & scores) const;
174
191 const std::vector<TransitionType> & transitions,
192 const CompoundType& compound,
193 const double normalized_feature_rt,
194 OpenSwath_Scores & scores);
195
217 const std::vector<TransitionType>& transitions,
218 const std::vector<double>& normalized_library_intensity,
219 const std::vector<OpenSwath::SwathMap>& swath_maps,
220 const OpenSwath::SpectrumAccessPtr& ms1_map,
221 const OpenMS::DIAScoring& diascoring,
222 const CompoundType& compound,
223 OpenSwath_Scores& scores,
224 std::vector<double>& mzerror_ppm,
225 const double drift_target,
226 const RangeMobility& range_im,
227 MobilogramParquetConsumer* mobilogram_consumer = nullptr,
228 Int64 feature_id = -1,
229 ScoreSubset subset = ScoreSubset::ALL);
230
245 const OpenMS::DIAScoring& diascoring,
246 double precursor_mz,
247 double rt,
248 const CompoundType& compound,
249 RangeMobility im_range,
250 OpenSwath_Scores& scores);
251
269 const TransitionType & transition,
270 MRMTransitionGroupType& transition_group_detection,
271 const std::vector<OpenSwath::SwathMap>& swath_maps,
272 RangeMobility& range_im,
273 const OpenMS::DIAScoring & diascoring,
274 OpenSwath_Scores & scores,
275 const double drift_target,
276 MobilogramParquetConsumer* mobilogram_consumer = nullptr,
277 Int64 feature_id = -1);
278
306 SpectrumSequence fetchSpectrumSwath(const std::vector<OpenSwath::SwathMap>& swath_maps, double RT, int nr_spectra_to_add, const RangeMobility& im_range);
307
320 void fetchSpectrumSwath(const std::vector<OpenSwath::SwathMap>& swath_maps, double RT, int nr_spectra_to_add, const RangeMobility& im_range, SpectrumSequence& out);
321
322
347 SpectrumSequence fetchSpectrumSwath(OpenSwath::SpectrumAccessPtr swath_map, double RT, int nr_spectra_to_add, const RangeMobility& im_range);
348
361 void fetchSpectrumSwath(OpenSwath::SpectrumAccessPtr swath_map, double RT, int nr_spectra_to_add, const RangeMobility& im_range, SpectrumSequence& out);
362 };
363}
Scoring of an spectrum at the peak apex of an chromatographic elution peak.
Definition DIAScoring.h:64
The representation of a group of transitions in a targeted proteomics experiment.
Definition MRMTransitionGroup.h:41
Writes Mobilograms (ion-mobility traces) to a Parquet file using a PyProphet-compatible-like schema.
Definition MobilogramParquetConsumer.h:25
Definition OpenSwathScoring.h:45
void calculateLibraryScores(OpenSwath::IMRMFeature *imrmfeature, const std::vector< TransitionType > &transitions, const CompoundType &compound, const double normalized_feature_rt, OpenSwath_Scores &scores)
Score a single chromatographic feature against a spectral library.
OpenSwathScoring()
Constructor.
MRMTransitionGroup< MSChromatogram, TransitionType > MRMTransitionGroupType
Definition OpenSwathScoring.h:48
SpectrumAdditionMethod
Definition OpenSwathScoring.h:51
double merge_spectra_by_peak_width_fraction_
Definition OpenSwathScoring.h:64
void calculatePrecursorDIAScores(const OpenSwath::SpectrumAccessPtr &ms1_map, const OpenMS::DIAScoring &diascoring, double precursor_mz, double rt, const CompoundType &compound, RangeMobility im_range, OpenSwath_Scores &scores)
Score a single chromatographic feature using the precursor map.
bool apply_im_peak_picking_
whether to apply peak picking on ion mobilograms
Definition OpenSwathScoring.h:71
SpectrumSequence fetchSpectrumSwath(OpenSwath::SpectrumAccessPtr swath_map, double RT, int nr_spectra_to_add, const RangeMobility &im_range)
Prepares a spectrum for DIA analysis (multiple map)
int add_up_spectra_
Definition OpenSwathScoring.h:65
double spacing_for_spectra_resampling_
Definition OpenSwathScoring.h:63
void calculateDIAIdScores(OpenSwath::IMRMFeature *imrmfeature, const TransitionType &transition, MRMTransitionGroupType &transition_group_detection, const std::vector< OpenSwath::SwathMap > &swath_maps, RangeMobility &range_im, const OpenMS::DIAScoring &diascoring, OpenSwath_Scores &scores, const double drift_target, MobilogramParquetConsumer *mobilogram_consumer=nullptr, Int64 feature_id=-1)
Score a single chromatographic feature using DIA / SWATH scores.
SpectrumAdditionMethod spectra_addition_method_
Definition OpenSwathScoring.h:66
double im_drift_extra_pcnt_
Definition OpenSwathScoring.h:68
void calculateChromatographicIdScores(OpenSwath::IMRMFeature *imrmfeature, const std::vector< std::string > &native_ids_identification, const std::vector< std::string > &native_ids_detection, std::vector< OpenSwath::ISignalToNoisePtr > &signal_noise_estimators, OpenSwath_Ind_Scores &scores) const
Score identification transitions against detection transitions of a single peakgroup in a chromatogra...
OpenSwath::LightTransition TransitionType
Definition OpenSwathScoring.h:47
double rt_normalization_factor_
Definition OpenSwathScoring.h:62
OpenSwath_Scores_Usage su_
Definition OpenSwathScoring.h:69
OpenSwath::LightCompound CompoundType
Definition OpenSwathScoring.h:46
void fetchSpectrumSwath(const std::vector< OpenSwath::SwathMap > &swath_maps, double RT, int nr_spectra_to_add, const RangeMobility &im_range, SpectrumSequence &out)
Fill a caller-provided spectrum sequence for DIA analysis.
void initialize(double rt_normalization_factor, int add_up_spectra, double spacing_for_spectra_resampling, double merge_spectra_by_peak_width_fraction, const double drift_extra, const OpenSwath_Scores_Usage &su, const std::string &spectrum_addition_method, const std::string &spectrum_merge_method_type, bool use_ms1_ion_mobility, bool apply_im_peak_picking)
Initialize the scoring object.
SpectrumSequence fetchSpectrumSwath(const std::vector< OpenSwath::SwathMap > &swath_maps, double RT, int nr_spectra_to_add, const RangeMobility &im_range)
Prepares a spectrum for DIA analysis (single map)
ScoreSubset
Which of the enabled scores calculateChromatographicScores() and calculateDIAScores() compute.
Definition OpenSwathScoring.h:85
bool use_ms1_ion_mobility_
whether to use MS1 ion mobility extraction in DIA scores
Definition OpenSwathScoring.h:70
void fetchSpectrumSwath(OpenSwath::SpectrumAccessPtr swath_map, double RT, int nr_spectra_to_add, const RangeMobility &im_range, SpectrumSequence &out)
Fill a caller-provided spectrum sequence for DIA analysis.
void calculateChromatographicScores(OpenSwath::IMRMFeature *imrmfeature, const std::vector< std::string > &native_ids, const std::vector< std::string > &precursor_ids, const std::vector< double > &normalized_library_intensity, std::vector< OpenSwath::ISignalToNoisePtr > &signal_noise_estimators, OpenSwath_Scores &scores, ScoreSubset subset=ScoreSubset::ALL) const
Score a single peakgroup in a chromatogram using only chromatographic properties.
SpectrumMergeMethodType
Definition OpenSwathScoring.h:57
void calculateDIAScores(OpenSwath::IMRMFeature *imrmfeature, const std::vector< TransitionType > &transitions, const std::vector< double > &normalized_library_intensity, const std::vector< OpenSwath::SwathMap > &swath_maps, const OpenSwath::SpectrumAccessPtr &ms1_map, const OpenMS::DIAScoring &diascoring, const CompoundType &compound, OpenSwath_Scores &scores, std::vector< double > &mzerror_ppm, const double drift_target, const RangeMobility &range_im, MobilogramParquetConsumer *mobilogram_consumer=nullptr, Int64 feature_id=-1, ScoreSubset subset=ScoreSubset::ALL)
Score a single chromatographic feature using DIA / SWATH scores.
~OpenSwathScoring()
Destructor.
SpectrumMergeMethodType spectra_merge_method_type_
Definition OpenSwathScoring.h:67
Definition ITransition.h:31
int64_t Int64
Signed integer type (64bit)
Definition Types.h:40
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
std::vector< OpenSwath::SpectrumPtr > SpectrumSequence
a vector of spectrum pointers that DIA scores can operate on, allows for clever integration of only t...
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:20
@ ALL
all dimensions are filled
A structure to store which scores should be used by the OpenSWATH Algorithm.
Definition OpenSwathScores.h:25
std::shared_ptr< ISpectrumAccess > SpectrumAccessPtr
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:146
A structure to hold the individual scores computed for unique ion signatures (UIS) scores for the Inf...
Definition OpenSwathScores.h:181
A structure to hold the different scores computed by OpenSWATH.
Definition OpenSwathScores.h:57
Definition RangeManager.h:482
Definition TransitionExperiment.h:269
Definition TransitionExperiment.h:106