![]() |
OpenMS
|
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/SpectralDeconvolution.h>
Public Types | |
| typedef FLASHHelperClasses::PrecalculatedAveragine | PrecalculatedAveragine |
| typedef FLASHHelperClasses::LogMzPeak | LogMzPeak |
Public Member Functions | |
| SpectralDeconvolution () | |
| default constructor More... | |
| SpectralDeconvolution (const SpectralDeconvolution &)=default | |
| copy constructor More... | |
| SpectralDeconvolution (SpectralDeconvolution &&other)=default | |
| move constructor More... | |
| SpectralDeconvolution & | operator= (const SpectralDeconvolution &fd)=default |
| assignment operator More... | |
| SpectralDeconvolution & | operator= (SpectralDeconvolution &&fd)=default |
| move assignment operator More... | |
| ~SpectralDeconvolution ()=default | |
| destructor More... | |
| void | performSpectrumDeconvolution (const MSSpectrum &spec, int scan_number, const PeakGroup &precursor_peak_group) |
| main deconvolution function that generates the deconvolved target and dummy spectrum based on the original spectrum. More... | |
| DeconvolvedSpectrum & | getDeconvolvedSpectrum () |
| return deconvolved spectrum More... | |
| const PrecalculatedAveragine & | getAveragine () |
| get calculated averagine. Call after calculateAveragine is called. More... | |
| void | setAveragine (const PrecalculatedAveragine &avg) |
| set calculated averagine More... | |
| void | setTargetMasses (const std::vector< double > &masses, bool exclude=false) |
| set targeted or excluded masses for targeted deconvolution. Masses are targeted or excluded in all ms levels. More... | |
| void | calculateAveragine (bool use_RNA_averagine) |
| precalculate averagine (for predefined mass bins) to speed up averagine generation More... | |
| void | setToleranceEstimation () |
| when estimating tolerance, max_mass_dalton_tolerance_ should be large More... | |
| void | setTargetDecoyType (PeakGroup::TargetDecoyType target_decoy_type, const DeconvolvedSpectrum &target_dspec_for_decoy_calcualtion) |
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... | |
| 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 (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 offset, int min_iso_len) |
| static float | getIsotopeCosineAndIsoOffset (double mono_mass, const std::vector< float > &per_isotope_intensities, int &offset, const PrecalculatedAveragine &avg, int iso_int_shift, int window_width, const std::vector< double > &excluded_masses) |
| 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... | |
Static Public Attributes | |
| static const int | min_iso_size = 2 |
| minimum isotopologue count in a peak group 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_ () |
| generate log mz peaks from the input spectrum More... | |
| void | binLogMzPeaks_ (Size bin_number, std::vector< float > &binned_log_mz_peak_intensities) |
| generate mz bins and intensity per mz bin from log mz peaks More... | |
| double | getMassFromMassBin_ (Size mass_bin, double bin_mul_factor) const |
| get mass value for input mass bin: used for debugging More... | |
| double | getMzFromMzBin_ (Size mass_bin, double bin_mul_factor) const |
| get mz value for input mz bin: used for debugging More... | |
| void | generatePeakGroupsFromSpectrum_ () |
| Generate peak groups from the input spectrum. More... | |
| Matrix< int > | updateMassBins_ (const std::vector< float > &mz_intensities) |
| Update binned_log_masses_. 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 binned_log_masses_ using the universal pattern, eliminate possible harmonic masses. More... | |
| void | getCandidatePeakGroups_ (const Matrix< int > &per_mass_abs_charge_ranges) |
| For selected masses in binned_log_masses_, 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 | removeChargeErrorPeakGroups_ (DeconvolvedSpectrum &dspec, const PeakGroup::TargetDecoyType &target_decoy_type) const |
| filter out charge error masses More... | |
| void | removeExcludedMasses_ (DeconvolvedSpectrum &dspec, std::vector< double > excluded_masses, double tol) const |
| filter out excluded masses More... | |
| void | setTargetPrecursorCharge_ () |
| void | prepareSignalDecoyExclusions_ () |
| prepare signal decoy exclusions for decoy runs More... | |
| void | prepareNoiseDecoySpectrum_ (const MSSpectrum &spec) |
| prepare noise decoy spectrum by filtering signal peaks More... | |
| void | registerPrecursorForMSn_ (const PeakGroup &precursor_peak_group) |
| register precursor information for MSn spectra (n > 1) More... | |
| bool | isPeakGroupInExcludedMassForDecoyRuns_ (const PeakGroup &peak_group, double tol, int offset=0) const |
Static Private Member Functions | |
| static double | getBinValue_ (Size bin, double min_value, double bin_mul_factor) |
| static function that converts bin to value More... | |
| static Size | getBinNumber_ (double value, double min_value, double bin_mul_factor) |
| static function that converts value to bin More... | |
| static void | removeOverlappingPeakGroups_ (DeconvolvedSpectrum &dspec, double tol, PeakGroup::TargetDecoyType target_decoy_type=PeakGroup::TargetDecoyType::target) |
| filter out overlapping masses More... | |
Private Attributes | |
| int | allowed_iso_error_ = -1 |
| FLASHDeconv parameters. More... | |
| 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... | |
| double | min_mass_ |
| mass ranges of deconvolution, set by users More... | |
| double | max_mass_ |
| 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 | noise_iso_delta_ = .9444 |
| isotope distance for noise decoy. This distance has been determined so i) it is close to the mass of 13C - 12C yet is not close to any correct isotope distances of different charges (from 1 to 10). More... | |
| DoubleList | tolerance_ |
| tolerance in ppm for each MS level More... | |
| DoubleList | bin_mul_factors_ |
| bin multiplication factor (log mz * bin_mul_factors_ = bin number) - for fast convolution, binning is used More... | |
| DoubleList | min_isotope_cosine_ |
| Isotope cosine threshold for each MS level. More... | |
| DoubleList | min_snr_ |
| snr threshold for each MS level More... | |
| double | min_qscore_ = .2 |
| minimum Qscore of a deconvolved mass More... | |
| const DeconvolvedSpectrum * | target_dspec_for_decoy_calculation_ |
| the peak group vector from normal run. This is used when dummy masses are generated. More... | |
| PeakGroup::TargetDecoyType | target_decoy_type_ = PeakGroup::TargetDecoyType::target |
| PeakGroup::TargetDecoyType values. More... | |
| FLASHHelperClasses::PrecalculatedAveragine | avg_ |
| precalculated averagine distributions for fast averagine generation More... | |
| boost::dynamic_bitset | target_mass_bins_ |
| mass bins that are targeted for FLASHIda global targeting mode More... | |
| std::vector< double > | target_mono_masses_ |
| std::vector< double > | excluded_masses_ |
| mass bins that are excluded for FLASHIda global targeting mode More... | |
| boost::dynamic_bitset | excluded_mass_bins_for_decoy_runs_ |
| mass bins that are previously deconvolved and excluded for decoy mass generation More... | |
| std::vector< double > | excluded_peak_masses_for_decoy_runs_ |
| std::vector< double > | excluded_masses_for_decoy_runs_ |
| std::vector< LogMzPeak > | log_mz_peaks_ |
| Stores log mz peaks. More... | |
| DeconvolvedSpectrum | deconvolved_spectrum_ |
| selected_peak_groups_ stores the deconvolved mass peak groups More... | |
| boost::dynamic_bitset | binned_log_masses_ |
| binned_log_masses_ stores the selected bins for this spectrum + overlapped spectrum (previous a few spectra). More... | |
| boost::dynamic_bitset | binned_log_mz_peaks_ |
| binned_log_mz_peaks_ stores the binned log mz peaks More... | |
| std::vector< double > | universal_pattern_ |
| This stores the "universal pattern". More... | |
| Matrix< double > | harmonic_pattern_matrix_ |
| This stores the patterns for harmonic reduction. More... | |
| std::vector< int > | binned_universal_pattern_ |
| This stores the "universal pattern" in binned dimension. More... | |
| Matrix< int > | binned_harmonic_patterns |
| 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_ |
| uint | ms_level_ |
| current ms Level More... | |
| double | iso_da_distance_ |
| isotope dalton distance More... | |
| int | target_precursor_charge_ = 0 |
| for precursor targetting. More... | |
| double | target_precursor_mz_ = 0 |
| double | max_mass_dalton_tolerance_ = .16 |
| this is additional mass tolerance in Da to get more high signal-to-ratio peaks in this candidate peakgroup finding More... | |
Static Private Attributes | |
| static const int | min_support_peak_count_ = 2 |
| minimum number of peaks supporting a mass More... | |
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
|
default |
destructor
|
private |
generate mz bins and intensity per mz bin from log mz peaks
| bin_number | number of mz bins |
| binned_log_mz_peak_intensities | intensity per mz bin |
| void calculateAveragine | ( | 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 |
|
private |
Subfunction of updateMassBins_.
| mass_intensities | per mass bin intensity |
|
private |
Generate peak groups from the input spectrum.
| const PrecalculatedAveragine& getAveragine | ( | ) |
get calculated averagine. Call after calculateAveragine is called.
|
staticprivate |
static function that converts value to bin
| value | value |
| min_value | minimum value (corresponding to bin number = 0) |
| bin_mul_factor | bin multiplication factor: bin_number = (bin_value * bin_mul_factors_ - min_value) |
|
staticprivate |
static function that converts bin to value
| bin | bin number |
| min_value | minimum value (corresponding to bin number = 0) |
| bin_mul_factor | bin multiplication factor: bin_value = (min_value + bin_number/ bin_mul_factors_) |
|
private |
For selected masses in binned_log_masses_, 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 |
| offset | element index offset between a and b |
| min_iso_len | minimum isotope size. If isotope size is less than this, return 0 |
| DeconvolvedSpectrum& getDeconvolvedSpectrum | ( | ) |
return deconvolved spectrum
|
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 | vector of intensities associated with each isotope - aggregated through charges |
| offset | output offset between input monoisotopic mono_mass and determined monoisotopic mono_mass |
| avg | precalculated averagine |
| iso_int_shift | isotope shift in per_isotope_intensities. |
| window_width | isotope offset value range. If -1, set automatically. |
| excluded_masses | masses not considered in the calculation. |
|
private |
get mass value for input mass bin: used for debugging
|
private |
get mz value for input mz bin: used for debugging
|
static |
convert double to nominal mass
|
private |
|
default |
assignment operator
|
default |
move assignment operator
| void performSpectrumDeconvolution | ( | const MSSpectrum & | spec, |
| int | scan_number, | ||
| const PeakGroup & | precursor_peak_group | ||
| ) |
main deconvolution function that generates the deconvolved target and dummy spectrum based on the original spectrum.
| spec | the original spectrum |
| scan_number | scan number from input spectrum. |
| precursor_peak_group | precursor peak group |
|
private |
prepare noise decoy spectrum by filtering signal peaks
|
private |
prepare signal decoy exclusions for decoy runs
|
private |
register precursor information for MSn spectra (n > 1)
|
private |
filter out charge error masses
|
private |
filter out excluded masses
|
staticprivate |
filter out overlapping masses
|
private |
function for peak group scoring and filtering
| void setAveragine | ( | const PrecalculatedAveragine & | avg | ) |
set calculated averagine
|
private |
Make the universal pattern.
| void setTargetDecoyType | ( | PeakGroup::TargetDecoyType | target_decoy_type, |
| const DeconvolvedSpectrum & | target_dspec_for_decoy_calcualtion | ||
| ) |
set target dummy type for the SpectralDeconvolution run. All masses from the target SpectralDeconvolution run will have the target_decoy_type_.
| target_decoy_type | This target_decoy_type_ specifies if a PeakGroup is a target (0), charge dummy (1), noise dummy (2), or isotope dummy (3) |
| target_dspec_for_decoy_calcualtion | target masses from normal deconvolution |
| void setTargetMasses | ( | const std::vector< double > & | masses, |
| bool | exclude = false |
||
| ) |
set targeted or excluded masses for targeted deconvolution. Masses are targeted or excluded in all ms levels.
| masses | target masses to set |
| exclude | if set, masses are excluded. |
|
private |
|
inline |
when estimating tolerance, max_mass_dalton_tolerance_ should be large
|
private |
Subfunction of updateMassBins_. It select candidate masses and update binned_log_masses_ 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 binned_log_masses_. 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 |
FLASHDeconv parameters.
allowed isotope error in deconvolved mass to calculate qvalue
|
private |
precalculated averagine distributions for fast averagine generation
|
private |
bin multiplication factor (log mz * bin_mul_factors_ = bin number) - for fast convolution, binning is used
|
private |
This stores the patterns for harmonic reduction in binned dimension.
|
private |
binned_log_masses_ stores the selected bins for this spectrum + overlapped spectrum (previous a few spectra).
|
private |
binned_log_mz_peaks_ stores the binned log mz peaks
|
private |
This stores the "universal pattern" in binned dimension.
|
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 |
max mass is max_mass for MS1 and 50 for MS2
|
private |
selected_peak_groups_ stores the deconvolved mass peak groups
|
private |
mass bins that are previously deconvolved and excluded for decoy mass generation
|
private |
mass bins that are excluded for FLASHIda global targeting mode
|
private |
|
private |
|
private |
This stores the patterns for harmonic reduction.
|
private |
is positive mode
|
private |
isotope dalton distance
|
private |
Stores log mz peaks.
|
private |
minimum mass and mz values representing the first bin of massBin and mzBin, respectively: to save memory space
|
private |
|
private |
|
private |
this is additional mass tolerance in Da to get more high signal-to-ratio peaks in this candidate peakgroup finding
|
private |
min charge and max charge subject to analysis, set by users
|
static |
minimum isotopologue count in a peak group
|
private |
Isotope cosine threshold for each MS level.
|
private |
mass ranges of deconvolution, set by users
|
private |
minimum Qscore of a deconvolved mass
|
private |
snr threshold for each MS level
|
staticprivate |
minimum number of peaks supporting a mass
|
private |
current ms Level
|
private |
|
private |
isotope distance for noise decoy. This distance has been determined so i) it is close to the mass of 13C - 12C yet is not close to any correct isotope distances of different charges (from 1 to 10).
|
private |
PeakGroup::TargetDecoyType values.
|
private |
the peak group vector from normal run. This is used when dummy masses are generated.
|
private |
mass bins that are targeted for FLASHIda global targeting mode
|
private |
|
private |
for precursor targetting.
|
private |
|
private |
tolerance in ppm for each MS level
|
private |
This stores the "universal pattern".