OpenMS
FLASHDeconvAlgorithm.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Kyowon Jeong, Jihyung Kim $
6 // $Authors: Kyowon Jeong, Jihyung Kim $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
19 #include <boost/dynamic_bitset.hpp>
20 #include <iostream>
21 
22 namespace OpenMS
23 {
34  class OPENMS_DLLAPI FLASHDeconvAlgorithm : public DefaultParamHandler, public ProgressLogger
35  {
36  public:
39 
41 
44 
47 
50 
52  ~FLASHDeconvAlgorithm() = default;
53 
60  void run(MSExperiment& map, std::vector<DeconvolvedSpectrum>& deconvolved_spectra, std::vector<FLASHDeconvHelperStructs::MassFeature>& deconvolved_feature);
61 
64 
65  protected:
66  void updateMembers_() override;
67 
68  private:
70  SpectralDeconvolution sd_, sd_charge_decoy_, sd_noise_decoy_, sd_isotope_decoy_;
71 
73  int merge_spec_ = 0;
74 
76  int forced_ms_level_ = 0;
77 
79  UInt max_ms_level_ = 4;
80 
82  UInt current_max_ms_level_ = 0;
83 
85  UInt current_min_ms_level_ = 0;
86 
88  int preceding_MS1_count_ = 0;
89 
92 
95 
97  bool use_RNA_averagine_ = false;
98 
100  bool report_decoy_ = false;
101 
104 
106  std::map<int, std::vector<std::vector<float>>> precursor_map_for_ida_;
108  std::map<String, PeakGroup> native_id_precursor_peak_group_map_;
109 
112 
114  void mergeSpectra_(MSExperiment& map, uint ms_level);
115 
117  void runSpectralDeconvolution_(MSExperiment& map, std::vector<DeconvolvedSpectrum>& deconvolved_spectra);
118 
120  void runFeatureFinding_(std::vector<DeconvolvedSpectrum>& deconvolved_spectra, std::vector<FLASHDeconvHelperStructs::MassFeature>& deconvolved_features);
121 
123  static void updatePrecursorQScores_(std::vector<DeconvolvedSpectrum>& deconvolved_spectra, int ms_level);
124 
126  void findPrecursorPeakGroupsFormIdaLog_(const MSExperiment& map, Size index, double start_mz, double end_mz);
127 
129  void findPrecursorPeakGroupsForMSnSpectra_(const MSExperiment& map, const std::vector<DeconvolvedSpectrum>& deconvolved_spectra, uint ms_level);
130 
132  static int getScanNumber_(const MSExperiment& map, Size index);
133 
135  static void filterLowPeaks_(MSExperiment& map);
136  };
137 } // namespace OpenMS
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:66
FLASHDeconv algorithm: ultrafast mass deconvolution algorithm for top down mass spectrometry dataset ...
Definition: FLASHDeconvAlgorithm.h:35
void runFeatureFinding_(std::vector< DeconvolvedSpectrum > &deconvolved_spectra, std::vector< FLASHDeconvHelperStructs::MassFeature > &deconvolved_features)
run feature finding to get deconvolved features
FLASHDeconvAlgorithm()
default constructor
void updateMSLevels_(MSExperiment &map)
read dataset to update ms level information
~FLASHDeconvAlgorithm()=default
destructor
DoubleList min_cos_
Definition: FLASHDeconvAlgorithm.h:94
FLASHDeconvAlgorithm(FLASHDeconvAlgorithm &&other)=default
copy constructor
static void filterLowPeaks_(MSExperiment &map)
filter low intensity peaks
void findPrecursorPeakGroupsFormIdaLog_(const MSExperiment &map, Size index, double start_mz, double end_mz)
find precursor peak groups from FLASHIda log file
void mergeSpectra_(MSExperiment &map, uint ms_level)
merge spectra
std::map< String, PeakGroup > native_id_precursor_peak_group_map_
a map from native ID to precursor peak group
Definition: FLASHDeconvAlgorithm.h:108
void runSpectralDeconvolution_(MSExperiment &map, std::vector< DeconvolvedSpectrum > &deconvolved_spectra)
run spectral deconvolution
static void updatePrecursorQScores_(std::vector< DeconvolvedSpectrum > &deconvolved_spectra, int ms_level)
with found deconvolved features, update QScores for masses that are contained in features.
FLASHDeconvAlgorithm & operator=(const FLASHDeconvAlgorithm &fd)=default
assignment operator
double isolation_window_size_
default precursor isolation window size.
Definition: FLASHDeconvAlgorithm.h:103
String ida_log_file_
FLASHIda log file name.
Definition: FLASHDeconvAlgorithm.h:91
SpectralDeconvolution sd_
SpectralDeconvolution instances for spectral deconvolution for target and decoys.
Definition: FLASHDeconvAlgorithm.h:70
const FLASHDeconvHelperStructs::PrecalculatedAveragine & getAveragine()
get calculated averagine. Call after calculateAveragine is called.
void findPrecursorPeakGroupsForMSnSpectra_(const MSExperiment &map, const std::vector< DeconvolvedSpectrum > &deconvolved_spectra, uint ms_level)
register the precursor peak group (or mass) if possible for MSn (n>1) spectrum.
void updateMembers_() override
This method is used to update extra member variables at the end of the setParameters() method.
FLASHDeconvAlgorithm & operator=(FLASHDeconvAlgorithm &&fd)=default
move assignment operator
std::map< int, std::vector< std::vector< float > > > precursor_map_for_ida_
FLASHIda parsing information is stored here: MS1 scan - information.
Definition: FLASHDeconvAlgorithm.h:106
static int getScanNumber_(const MSExperiment &map, Size index)
get scan number of the spectrum in index -th in map
void run(MSExperiment &map, std::vector< DeconvolvedSpectrum > &deconvolved_spectra, std::vector< FLASHDeconvHelperStructs::MassFeature > &deconvolved_feature)
Run FLASHDeconv algorithm for map and store deconvolved_spectra and deconvolved_feature.
Averagine patterns pre-calculated for speed up. Other variables are also calculated for fast cosine c...
Definition: FLASHDeconvHelperStructs.h:33
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:46
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:27
FLASHDeconv algorithm: ultrafast mass deconvolution algorithm for top down mass spectrometry dataset ...
Definition: SpectralDeconvolution.h:34
A more convenient string class.
Definition: String.h:34
unsigned int UInt
Unsigned integer type.
Definition: Types.h:68
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:101
std::vector< double > DoubleList
Vector of double precision real types.
Definition: ListUtils.h:36
FLASHIda C++ to C# (or vice versa) bridge functions The functions here are called in C# to invoke fun...
Definition: FeatureDeconvolution.h:22