![]() |
OpenMS
3.0.0
|
FLASHDeconv algorithm: ultrafast mass deconvolution algorithm for top down mass spectrometry dataset From MSSpectrum, this class outputs DeconvolvedSpectrum. Deconvolution takes three steps: i) decharging and select candidate masses - speed up via binning ii) collecting isotopes from the candidate masses and deisotope - peak groups are defined here iii) scoring and filter out low scoring masses (i.e., peak groups) More...
#include <OpenMS/ANALYSIS/TOPDOWN/FLASHDeconvAlgorithm.h>
Public Types | |
| typedef FLASHDeconvHelperStructs::PrecalculatedAveragine | PrecalculatedAveragine |
| typedef FLASHDeconvHelperStructs::LogMzPeak | LogMzPeak |
Public Member Functions | |
| FLASHDeconvAlgorithm () | |
| default constructor More... | |
| FLASHDeconvAlgorithm (const FLASHDeconvAlgorithm &)=default | |
| copy constructor More... | |
| FLASHDeconvAlgorithm (FLASHDeconvAlgorithm &&other)=default | |
| move constructor More... | |
| FLASHDeconvAlgorithm & | operator= (const FLASHDeconvAlgorithm &fd)=default |
| assignment operator More... | |
| void | performSpectrumDeconvolution (const MSSpectrum &spec, const std::vector< DeconvolvedSpectrum > &survey_scans, const int scan_number, const bool write_detail, const std::map< int, std::vector< std::vector< double >>> &precursor_map_for_FLASHIda) |
| main deconvolution function that generates the deconvolved and decoy deconvolved spectrum from the original spectrum. More... | |
| DeconvolvedSpectrum & | getDeconvolvedSpectrum () |
| return deconvolved spectrum More... | |
| DeconvolvedSpectrum & | getDecoyDeconvolvedSpectrum () |
| return decoy deconvolved spectrum More... | |
| const PrecalculatedAveragine & | getAveragine () |
| get calculated averagine. This should be called after calculateAveragine is called. More... | |
| void | setAveragine (const PrecalculatedAveragine &avg) |
| set calculated averagine More... | |
| void | setTargetMasses (const std::vector< double > &masses) |
| set targeted masses for targeted deconvolution. Masses are targeted in all ms levels More... | |
| void | calculateAveragine (const bool use_RNA_averagine) |
| precalculate averagine (for predefined mass bins) to speed up averagine generation More... | |
| void | addExcludedMonoMass (const double m) |
| void | clearExcludedMonoMasses () |
| void | setDecoyFlag (int flag) |
| set decoy_flag_ More... | |
Public Member Functions inherited from DefaultParamHandler | |
| DefaultParamHandler (const String &name) | |
| Constructor with name that is displayed in error messages. More... | |
| DefaultParamHandler (const DefaultParamHandler &rhs) | |
| Copy constructor. More... | |
| virtual | ~DefaultParamHandler () |
| Destructor. More... | |
| virtual DefaultParamHandler & | operator= (const DefaultParamHandler &rhs) |
| Assignment operator. More... | |
| virtual bool | operator== (const DefaultParamHandler &rhs) const |
| Equality operator. More... | |
| void | setParameters (const Param ¶m) |
| Sets the parameters. More... | |
| const Param & | getParameters () const |
| Non-mutable access to the parameters. More... | |
| const Param & | getDefaults () const |
| Non-mutable access to the default parameters. More... | |
| const String & | getName () const |
| Non-mutable access to the name. More... | |
| void | setName (const String &name) |
| Mutable access to the name. More... | |
| const std::vector< String > & | getSubsections () const |
| Non-mutable access to the registered subsections. More... | |
Static Public Member Functions | |
| static int | getNominalMass (const double mass) |
| convert double to nominal mass More... | |
| static float | getCosine (const std::vector< float > &a, int a_start, int a_end, const IsotopeDistribution &b, int b_size, int offset) |
| static float | getIsotopeCosineAndDetermineIsotopeIndex (const double mono_mass, const std::vector< float > &per_isotope_intensities, int &offset, int &second_best_iso_offset, const PrecalculatedAveragine &avg, int window_width=-1, int allowed_iso_error=1) |
| Examine intensity distribution over isotope indices. Also determines the most plausible isotope index or, monoisotopic mono_mass. More... | |
Static Public Member Functions inherited from DefaultParamHandler | |
| static void | writeParametersToMetaValues (const Param &write_this, MetaInfoInterface &write_here, const String &key_prefix="") |
| Writes all parameters to meta values. More... | |
Protected Member Functions | |
| void | updateMembers_ () override |
| This method is used to update extra member variables at the end of the setParameters() method. More... | |
Protected Member Functions inherited from DefaultParamHandler | |
| void | defaultsToParam_ () |
| Updates the parameters after the defaults have been set in the constructor. More... | |
Private Member Functions | |
| void | updateLogMzPeaks_ (const MSSpectrum *spec) |
| generate log mz peaks from the input spectrum More... | |
| void | updateMzBins_ (const Size bin_number, std::vector< float > &mz_bin_intensities) |
| generate mz bins and intensity per mz bin from log mz peaks More... | |
| void | unionPrevMassBins_ () |
| this function takes the previous deconvolution results (from ovelapped spectra) for sensitive deconvolution of the current spectrum More... | |
| void | generatePeakGroupsFromSpectrum_ () |
| Generate peak groups from the input spectrum. More... | |
| Matrix< int > | updateMassBins_ (const std::vector< float > &mz_intensities) |
| Update mass_bins_. It select candidate mass bins using the universal pattern, eliminate possible harmonic masses. This function does not perform deisotoping. More... | |
| Matrix< int > | filterMassBins_ (const std::vector< float > &mass_intensities) |
| Subfunction of updateMassBins_. More... | |
| void | updateCandidateMassBins_ (std::vector< float > &mass_intensities, const std::vector< float > &mz_intensities) |
| Subfunction of updateMassBins_. It select candidate masses and update mass_bins_ using the universal pattern, eliminate possible harmonic masses. More... | |
| void | getCandidatePeakGroups_ (const Matrix< int > &per_mass_abs_charge_ranges) |
| For selected masses in mass_bins_, select the peaks from the original spectrum. Also isotopic peaks are clustered in this function. More... | |
| void | setFilters_ () |
| Make the universal pattern. More... | |
| void | scoreAndFilterPeakGroups_ () |
| function for peak group scoring and filtering More... | |
| void | removeHarmonicsPeakGroups_ (DeconvolvedSpectrum &dpec) |
| void | removeOverlappingPeakGroups_ (DeconvolvedSpectrum &dpec, const double tol, const int iso_length=1) |
| filter out overlapping masses More... | |
| void | filterPeakGroupsByIsotopeCosine_ (const int current_max_mass_count) |
| Filter out masses with low isotope cosine scores, only retaining current_max_mass_count masses. More... | |
| bool | registerPrecursor (const std::vector< DeconvolvedSpectrum > &survey_scans, const std::map< int, std::vector< std::vector< double >>> &precursor_map_for_real_time_acquisition) |
| register the precursor peak as well as the precursor peak group (or mass) if possible for MSn (n>1) spectrum. Given a precursor peak (found in the original MS n-1 Spectrum) the masses containing the precursor peak are searched. If multiple masses are detected, the one with the best QScore is selected. For the selected mass, its corresponding peak group (along with precursor peak) is registered. If no such mass exists, only the precursor peak is registered. More... | |
Static Private Member Functions | |
| static double | getBinValue_ (const Size bin, const double min_value, const double bin_width) |
| static function that converts bin to value More... | |
| static Size | getBinNumber_ (const double value, const double min_value, const double bin_width) |
| static function that converts value to bin More... | |
Private Attributes | |
| int | allowed_iso_error_ = 1 |
| allowed isotope error in deconvolved mass to calculate qvalue More... | |
| double | min_rt_ |
| range of RT subject to analysis (in seconds) More... | |
| double | max_rt_ |
| double | min_mz_ |
| range of mz subject to analysis More... | |
| double | max_mz_ |
| int | min_abs_charge_ |
| min charge and max charge subject to analysis, set by users More... | |
| int | max_abs_charge_ |
| bool | is_positive_ |
| is positive mode More... | |
| bool | write_detail_ = false |
| to store detailed information More... | |
| double | min_mass_ |
| mass ranges of deconvolution, set by users More... | |
| double | max_mass_ |
| int | current_min_charge_ |
| current_min_charge_ charge: 1 for MSn n>1; otherwise just min_abs_charge_ More... | |
| int | current_max_charge_ |
| current_max_charge_: controlled by precursor charge for MSn n>1; otherwise just max_abs_charge_ More... | |
| double | current_max_mass_ |
| max mass is controlled by precursor mass for MSn n>1; otherwise just max_mass More... | |
| double | current_min_mass_ |
| max mass is max_mass for MS1 and 50 for MS2 More... | |
| double | intensity_threshold_ |
| peak intensity threshold subject to analysis More... | |
| const IntList | min_support_peak_count_ = {3,3,3,3,3,3,3,3} |
| minimum number of peaks supporting a mass More... | |
| DoubleList | tolerance_ |
| tolerance in ppm for each MS level More... | |
| DoubleList | bin_width_ |
| bin size for first stage of mass selection - for fast convolution, binning is used More... | |
| DoubleList | min_isotope_cosine_ |
| cosine threshold between observed and theoretical isotope patterns for each MS level More... | |
| int | decoy_run_flag_ = 0 |
| max mass count per spectrum for each MS level More... | |
| FLASHDeconvHelperStructs::PrecalculatedAveragine | avg_ |
| precalculated averagine distributions for fast averagine generation More... | |
| std::vector< std::vector< Size > > | prev_mass_bins_ms1_ |
| The data structures for spectra overlapping. More... | |
| std::vector< std::map< int, std::vector< Size > > > | prev_mass_bins_ms2_ |
| std::vector< double > | prev_rts_ms1_ |
| std::vector< double > | prev_rts_ms2_ |
| boost::dynamic_bitset | target_mass_bins_ |
| mass bins that are targeted for FLASHIda global targeting mode More... | |
| std::vector< double > | target_masses_ |
| boost::dynamic_bitset | excluded_mass_bins_ |
| mass bins that are excluded for decoy More... | |
| std::vector< double > | excluded_masses_ |
| const std::vector< int > | harmonic_charges_ {2, 3, 5, 7} |
| harmonic charge factors that will be considered for harmonic mass reduction. For example, 2 is for 1/2 charge harmonic component reduction More... | |
| std::vector< LogMzPeak > | log_mz_peaks_ |
| Stores log mz peaks. More... | |
| DeconvolvedSpectrum | deconvolved_spectrum_ |
| deconvolved_spectrum_ stores the deconvolved mass peak groups More... | |
| DeconvolvedSpectrum | decoy_deconvolved_spectrum_ |
| decoy_deconvolved_spectrum_ stores the deconvolved decoy mass peak groups More... | |
| boost::dynamic_bitset | mass_bins_ |
| mass_bins_ stores the selected bins for this spectrum + overlapped spectrum (previous a few spectra). More... | |
| boost::dynamic_bitset | mz_bins_ |
| mz_bins_ stores the binned log mz peaks More... | |
| boost::dynamic_bitset | mz_bins_for_edge_effect_ |
| mz_bins_for_edge_effect_ stores the binned log mz peaks, considering edge effect More... | |
| std::vector< double > | filter_ |
| This stores the "universal pattern". More... | |
| Matrix< double > | harmonic_filter_matrix_ |
| This stores the patterns for harmonic reduction. More... | |
| double | iso_da_distance_ |
| isotope dalton distance More... | |
| std::vector< int > | bin_offsets_ |
| This stores the "universal pattern" in binned dimension. More... | |
| Matrix< int > | harmonic_bin_offset_matrix_ |
| This stores the patterns for harmonic reduction in binned dimension. More... | |
| double | mass_bin_min_value_ |
| minimum mass and mz values representing the first bin of massBin and mzBin, respectively: to save memory space More... | |
| double | mz_bin_min_value_ |
| int | ms_level_ |
| current ms Level More... | |
| const int | low_charge_ = 6 |
| high and low charges are differently deconvolved. This value determines the (inclusive) threshold for low charge. More... | |
| double | isolation_window_size_ |
| default precursor isolation window size. More... | |
| const int | max_peak_count_ = 30000 |
| allowed maximum peak count per spectrum - intensity based. More... | |
Static Private Attributes | |
| static const int | min_iso_size_ = 2 |
| FLASHDeconv parameters. More... | |
| static const int | charge_decoy_ = 1 |
| static const int | noise_decoy_ = 2 |
| static const int | isotope_decoy_ = 3 |
Additional Inherited Members | |
Protected Attributes inherited from DefaultParamHandler | |
| Param | param_ |
| Container for current parameters. More... | |
| Param | defaults_ |
| Container for default parameters. This member should be filled in the constructor of derived classes! More... | |
| std::vector< String > | subsections_ |
| Container for registered subsections. This member should be filled in the constructor of derived classes! More... | |
| String | error_name_ |
| Name that is displayed in error messages during the parameter checking. More... | |
| bool | check_defaults_ |
| If this member is set to false no checking if parameters in done;. More... | |
| bool | warn_empty_defaults_ |
| If this member is set to false no warning is emitted when defaults are empty;. More... | |
FLASHDeconv algorithm: ultrafast mass deconvolution algorithm for top down mass spectrometry dataset From MSSpectrum, this class outputs DeconvolvedSpectrum. Deconvolution takes three steps: i) decharging and select candidate masses - speed up via binning ii) collecting isotopes from the candidate masses and deisotope - peak groups are defined here iii) scoring and filter out low scoring masses (i.e., peak groups)
default constructor
|
default |
copy constructor
|
default |
move constructor
| void addExcludedMonoMass | ( | const double | m | ) |
Referenced by TOPPFLASHDeconv::main_().
| void calculateAveragine | ( | const bool | use_RNA_averagine | ) |
precalculate averagine (for predefined mass bins) to speed up averagine generation
| use_RNA_averagine | if set, averagine for RNA (nucleotides) is calculated |
| void clearExcludedMonoMasses | ( | ) |
Referenced by TOPPFLASHDeconv::main_().
|
private |
Subfunction of updateMassBins_.
| mass_intensities | per mass bin intensity |
|
private |
Filter out masses with low isotope cosine scores, only retaining current_max_mass_count masses.
|
private |
Generate peak groups from the input spectrum.
| const PrecalculatedAveragine& getAveragine | ( | ) |
get calculated averagine. This should be called after calculateAveragine is called.
|
staticprivate |
static function that converts value to bin
| value | value |
| min_value | minimum value (corresponding to bin number = 0) |
| bin_width | bin width |
|
staticprivate |
static function that converts bin to value
| bin | bin number |
| min_value | minimum value (corresponding to bin number = 0) |
| bin_width | bin width |
|
private |
For selected masses in mass_bins_, select the peaks from the original spectrum. Also isotopic peaks are clustered in this function.
| per_mass_abs_charge_ranges | charge range per mass |
|
static |
calculate cosine between two vectors a and b with additional parameters for fast calculation
| a | vector a |
| a_start | non zero start index of a |
| a_end | non zero end index of a (exclusive) |
| b | vector b |
| b_size | size of b |
| offset | element index offset between a and b |
| DeconvolvedSpectrum& getDeconvolvedSpectrum | ( | ) |
return deconvolved spectrum
| DeconvolvedSpectrum& getDecoyDeconvolvedSpectrum | ( | ) |
return decoy deconvolved spectrum
Referenced by TOPPFLASHDeconv::main_().
|
static |
Examine intensity distribution over isotope indices. Also determines the most plausible isotope index or, monoisotopic mono_mass.
| mono_mass | monoisotopic mass |
| per_isotope_intensities | per isotope intensity - aggregated through charges |
| offset | output offset between input monoisotopic mono_mass and determined monoisotopic mono_mass |
| second_best_iso_offset | second best scoring isotope offset - for decoy calculation. |
| avg | precalculated averagine |
| window_width | isotope offset value range. If -1, set automatically. |
| allowed_iso_error | allowed isotope error to calculate qscure |
|
static |
convert double to nominal mass
|
default |
assignment operator
| void performSpectrumDeconvolution | ( | const MSSpectrum & | spec, |
| const std::vector< DeconvolvedSpectrum > & | survey_scans, | ||
| const int | scan_number, | ||
| const bool | write_detail, | ||
| const std::map< int, std::vector< std::vector< double >>> & | precursor_map_for_FLASHIda | ||
| ) |
main deconvolution function that generates the deconvolved and decoy deconvolved spectrum from the original spectrum.
| spec | the original spectrum |
| survey_scans | the survey scans to assign precursor mass to the deconvolved spectrum. |
| scan_number | scan number is provided from input spectrum to this function in most cases. But this parameter is used for real time deconvolution where scan number may be put separately. |
| precursor_map_for_FLASHIda | deconvolved precursor information from FLASHIda |
Referenced by TOPPFLASHDeconv::main_().
|
private |
register the precursor peak as well as the precursor peak group (or mass) if possible for MSn (n>1) spectrum. Given a precursor peak (found in the original MS n-1 Spectrum) the masses containing the precursor peak are searched. If multiple masses are detected, the one with the best QScore is selected. For the selected mass, its corresponding peak group (along with precursor peak) is registered. If no such mass exists, only the precursor peak is registered.
| survey_scans | the candidate precursor spectra - the user may allow search of previous N survey scans. |
| precursor_map_for_real_time_acquisition | this contains the deconvolved mass information from FLASHIda runs. |
|
private |
|
private |
filter out overlapping masses
|
private |
function for peak group scoring and filtering
| void setAveragine | ( | const PrecalculatedAveragine & | avg | ) |
set calculated averagine
Referenced by TOPPFLASHDeconv::main_().
| void setDecoyFlag | ( | int | flag | ) |
set decoy_flag_
Referenced by TOPPFLASHDeconv::main_().
|
private |
Make the universal pattern.
| void setTargetMasses | ( | const std::vector< double > & | masses | ) |
set targeted masses for targeted deconvolution. Masses are targeted in all ms levels
|
private |
this function takes the previous deconvolution results (from ovelapped spectra) for sensitive deconvolution of the current spectrum
|
private |
Subfunction of updateMassBins_. It select candidate masses and update mass_bins_ using the universal pattern, eliminate possible harmonic masses.
| mass_intensities | mass bin intensities which are updated in this function |
| mz_intensities | mz bin intensities |
|
private |
generate log mz peaks from the input spectrum
|
private |
Update mass_bins_. It select candidate mass bins using the universal pattern, eliminate possible harmonic masses. This function does not perform deisotoping.
| mz_intensities | per mz bin intensity |
|
overrideprotectedvirtual |
This method is used to update extra member variables at the end of the setParameters() method.
Also call it at the end of the derived classes' copy constructor and assignment operator.
The default implementation is empty.
Reimplemented from DefaultParamHandler.
|
private |
generate mz bins and intensity per mz bin from log mz peaks
| bin_number | number of mz bins |
| mz_bin_intensities | intensity per mz bin |
|
private |
allowed isotope error in deconvolved mass to calculate qvalue
|
private |
precalculated averagine distributions for fast averagine generation
|
private |
This stores the "universal pattern" in binned dimension.
|
private |
bin size for first stage of mass selection - for fast convolution, binning is used
|
staticprivate |
|
private |
current_max_charge_: controlled by precursor charge for MSn n>1; otherwise just max_abs_charge_
|
private |
max mass is controlled by precursor mass for MSn n>1; otherwise just max_mass
|
private |
current_min_charge_ charge: 1 for MSn n>1; otherwise just min_abs_charge_
|
private |
max mass is max_mass for MS1 and 50 for MS2
|
private |
deconvolved_spectrum_ stores the deconvolved mass peak groups
|
private |
decoy_deconvolved_spectrum_ stores the deconvolved decoy mass peak groups
|
private |
max mass count per spectrum for each MS level
if it is set to 0, not a decoy run. If 1, the charge decoy run, If 2, the random noise decoy run
|
private |
mass bins that are excluded for decoy
|
private |
|
private |
This stores the "universal pattern".
|
private |
This stores the patterns for harmonic reduction in binned dimension.
|
private |
harmonic charge factors that will be considered for harmonic mass reduction. For example, 2 is for 1/2 charge harmonic component reduction
|
private |
This stores the patterns for harmonic reduction.
|
private |
peak intensity threshold subject to analysis
|
private |
is positive mode
|
private |
isotope dalton distance
|
private |
default precursor isolation window size.
|
staticprivate |
|
private |
Stores log mz peaks.
|
private |
high and low charges are differently deconvolved. This value determines the (inclusive) threshold for low charge.
|
private |
minimum mass and mz values representing the first bin of massBin and mzBin, respectively: to save memory space
|
private |
mass_bins_ stores the selected bins for this spectrum + overlapped spectrum (previous a few spectra).
|
private |
|
private |
|
private |
|
private |
allowed maximum peak count per spectrum - intensity based.
|
private |
|
private |
min charge and max charge subject to analysis, set by users
|
staticprivate |
FLASHDeconv parameters.
minimum isotopologue count in a peak group
|
private |
cosine threshold between observed and theoretical isotope patterns for each MS level
|
private |
mass ranges of deconvolution, set by users
|
private |
range of mz subject to analysis
|
private |
range of RT subject to analysis (in seconds)
|
private |
minimum number of peaks supporting a mass
|
private |
current ms Level
|
private |
|
private |
mz_bins_ stores the binned log mz peaks
|
private |
mz_bins_for_edge_effect_ stores the binned log mz peaks, considering edge effect
|
staticprivate |
|
private |
The data structures for spectra overlapping.
|
private |
|
private |
|
private |
|
private |
mass bins that are targeted for FLASHIda global targeting mode
|
private |
|
private |
tolerance in ppm for each MS level
|
private |
to store detailed information