![]() |
OpenMS
|
Class describing a deconvolved mass. A mass contains multiple (LogMz) peaks of different charges and isotope indices. PeakGroup is the set of such peaks representing a single monoisotopic mass. PeakGroup also contains features that define the quality of it. It is used for PeakGroupScoring calculation. DeconvolvedSpectrum consists of PeakGroups. More...
#include <OpenMS/ANALYSIS/TOPDOWN/PeakGroup.h>
Public Types | |
| enum | TargetDecoyType { target = 0 , noise_decoy , signal_decoy } |
Public Member Functions | |
| PeakGroup ()=default | |
| default constructor More... | |
| PeakGroup (int min_abs_charge, int max_abs_charge, bool is_positive) | |
| Constructor specifying charge range. More... | |
| ~PeakGroup ()=default | |
| default destructor More... | |
| PeakGroup (const PeakGroup &)=default | |
| copy constructor More... | |
| PeakGroup (PeakGroup &&other)=default | |
| move constructor More... | |
| bool | operator< (const PeakGroup &a) const |
| comparison operators More... | |
| bool | operator> (const PeakGroup &a) const |
| bool | operator== (const PeakGroup &a) const |
| PeakGroup & | operator= (const PeakGroup &t)=default |
| assignment operator More... | |
| void | updateMonoMassAndIsotopeIntensities (double tol) |
| add monoisotopic indices of peaks by offset and discard negative isotope peaks. Total intensity is also updated More... | |
| int | updateQscore (const std::vector< LogMzPeak > &noisy_peaks, const FLASHHelperClasses::PrecalculatedAveragine &avg, double min_cos, double tol, bool is_low_charge, const std::vector< double > &excluded_masses, bool is_last=false) |
| Update setQscore. Cosine and SNRs are also updated. More... | |
| std::vector< LogMzPeak > | recruitAllPeaksInSpectrum (const MSSpectrum &spec, double tol, const FLASHHelperClasses::PrecalculatedAveragine &avg, double mono_mass, bool renew_signal_peaks=true) |
| given a monoisotopic mass, recruit raw peaks from the raw input spectrum and add to this peakGroup. This is a bit time-consuming and is done for only a small number of selected high-quality peakgroups. More... | |
| std::vector< LogMzPeak > | getNoisyPeaks (const MSSpectrum &spec, double tol, const FLASHHelperClasses::PrecalculatedAveragine &avg) const |
| Get noisy peaks for this PeakGroup without modifying any state (const-safe). This is a const alternative to recruitAllPeaksInSpectrum(..., false) for use in output/write functions. More... | |
| void | setScanNumber (int scan_number) |
| set scan number More... | |
| void | setChargeIsotopeCosine (int abs_charge, float cos) |
| set per abs_charge isotope cosine More... | |
| void | setAbsChargeRange (int min_abs_charge, int max_abs_charge) |
| set min_abs_charge and max_abs_charge charge range More... | |
| void | setIsotopeCosine (float cos) |
| set isotope cosine score More... | |
| void | setRepAbsCharge (int max_snr_abs_charge) |
| set representative max_snr_abs_charge More... | |
| void | setMonoisotopicMass (double mono_mass) |
| set monoisotopic mass More... | |
| void | setQscore (double qscore) |
| set Qscore - for FLASHIda log file parsing More... | |
| void | setChargeScore (float charge_score) |
| set charge score - for FLASHIda log file parsing More... | |
| void | setAvgPPMError (float error) |
| set average mass ppm error More... | |
| void | setSNR (float snr) |
| set SNR manually - for FLASHIda log file parsing More... | |
| void | setChargeSNR (int abs_charge, float c_snr) |
| set charge SNR manually - for FLASHIda log file parsing More... | |
| void | setTargeted () |
| set if it is targeted More... | |
| int | getScanNumber () const |
| get scan number More... | |
| double | getMonoMass () const |
| get monoisotopic mass More... | |
| float | getIntensity () const |
| get intensity More... | |
| float | getChargeSNR (int abs_charge) const |
| get per abs_charge SNR More... | |
| float | getChargeIsotopeCosine (int abs_charge) const |
| get per abs_charge isotope cosine More... | |
| float | getChargeIntensity (int abs_charge) const |
| get per abs_charge intenstiy More... | |
| std::tuple< double, double > | getRepMzRange () const |
| get mz range that results in max setQscore More... | |
| std::tuple< double, double > | getMzRange (int abs_charge) const |
| get mz range of the charge More... | |
| std::tuple< int, int > | getAbsChargeRange () const |
| get charge range - the actual charge values More... | |
| const std::vector< float > & | getIsotopeIntensities () const |
| get per isotope intensities More... | |
| float | getIsotopeCosine () const |
| get isotopic cosine score More... | |
| float | getPeakOccupancy () const |
| get the density of the peaks within charge and isotope range More... | |
| int | getRepAbsCharge () const |
| get representative charge More... | |
| double | getQscore () const |
| Get the one-dimensional quality score for this peak group. More... | |
| double | getQscore2D () const |
| Get the two-dimensional quality score incorporating feature-level information. More... | |
| float | getSNR () const |
| get total SNR More... | |
| float | getChargeScore () const |
| get charge score More... | |
| float | getAvgPPMError () const |
| get average mass ppm error; More... | |
| float | getAvgDaError () const |
| get average mass ppm error; More... | |
| bool | isPositive () const |
| get if it is positive mode More... | |
| bool | isTargeted () const |
| get if it is targeted More... | |
| PeakGroup::TargetDecoyType | getTargetDecoyType () const |
| get the target decoy type of this More... | |
| void | setTargetDecoyType (PeakGroup::TargetDecoyType index) |
| for this PeakGroup, specify the target decoy type. More... | |
| float | getQvalue () const |
| void | setQvalue (double q) |
| void | setIsotopeDaDistance (double d) |
| set distance between consecutive isotopes More... | |
| double | getIsotopeDaDistance () const |
| get distance between consecutive isotopes More... | |
| int | getMinNegativeIsotopeIndex () const |
| get minimum neagative isotope index More... | |
| void | setIndex (uint i) |
| set index of this peak group More... | |
| void | setQscore2D (double fqscore) |
| Set the two-dimensional quality score for this peak group. More... | |
| void | setFeatureIndex (uint findex) |
| Set the feature index for this peak group. More... | |
| uint | getIndex () const |
| get index of this peak group More... | |
| uint | getFeatureIndex () const |
| Get the feature index associated with this peak group. More... | |
| std::vector< FLASHHelperClasses::LogMzPeak >::const_iterator | begin () const noexcept |
| iterators for the signal LogMz peaks in this PeakGroup More... | |
| std::vector< FLASHHelperClasses::LogMzPeak >::const_iterator | end () const noexcept |
| std::vector< FLASHHelperClasses::LogMzPeak >::iterator | begin () noexcept |
| std::vector< FLASHHelperClasses::LogMzPeak >::iterator | end () noexcept |
| const FLASHHelperClasses::LogMzPeak & | operator[] (Size i) const |
| std::vector< float > | getMassErrors (bool ppm=true) const |
| Get mass errors for each isotope index in this peak group. More... | |
| void | push_back (const FLASHHelperClasses::LogMzPeak &pg) |
| vector operators for the LogMzPeaks in this PeakGroup More... | |
| FLASHHelperClasses::LogMzPeak & | back () |
| Size | size () const noexcept |
| void | reserve (Size n) |
| bool | empty () const |
| void | swap (std::vector< FLASHHelperClasses::LogMzPeak > &x) |
| void | sort () |
| std::tuple< std::vector< double >, std::vector< double > > | getDLVector (const MSSpectrum &spec, const Size charge_count, const Size isotope_count, const FLASHHelperClasses::PrecalculatedAveragine &avg, double tol) |
| Get deep learning feature vectors (signal and noise). More... | |
Private Types | |
| typedef FLASHHelperClasses::LogMzPeak | LogMzPeak |
| typedef FLASHHelperClasses::PrecalculatedAveragine | PrecalculatedAveragine |
Private Member Functions | |
| void | updateChargeFitScoreAndChargeIntensities_ (bool is_low_charge) |
| update chargefit score and also update per charge intensities here. More... | |
| void | updateAvgMassError_ () |
| update avg ppm error More... | |
| float | getPPMError_ (const LogMzPeak &p) const |
| update avg Da error More... | |
| float | getDaError_ (const LogMzPeak &p) const |
| get Da error of a logMzPeak from the closest isotope More... | |
| void | updateSNR_ (float mul_factor) |
| using signal and total (signal + noise) power, update SNR value More... | |
| void | clear_ () |
| clear peaks More... | |
| void | getPerIsotopeIntensities_ (std::vector< float > &intensities, int &min_isotope_index, int &max_isotope_index, int abs_charge, int min_negative_isotope_index, double tol) |
| calculate per isotope intensities. When abs_charge == 0, all peaks are considered More... | |
| void | updatePerChargeInformation_ (const std::vector< LogMzPeak > &noisy_peaks, double tol, bool is_last) |
| update per charge intensities, noise power, and squared intensities. used for SNR estimation More... | |
| void | updateChargeRange_ () |
| update the charge range using the calculated per charge information More... | |
| void | updatePerChargeCos_ (const FLASHHelperClasses::PrecalculatedAveragine &avg, double tol) |
| update per charge cosine values More... | |
| float | getNoisePeakPower_ (const std::vector< LogMzPeak > &noisy_peaks, int z, double tol) const |
Private Attributes | |
| std::vector< FLASHHelperClasses::LogMzPeak > | logMzpeaks_ |
| log Mz peaks More... | |
| std::vector< FLASHHelperClasses::LogMzPeak > | negative_iso_peaks_ |
| negative isotope index peaks More... | |
| std::vector< float > | per_charge_sum_signal_squared_ |
| per charge summed signal squared, noise pwr, SNR, isotope cosine, and intensity vectors More... | |
| std::vector< float > | per_charge_noise_pwr_ |
| std::vector< float > | per_charge_cos_ |
| std::vector< float > | per_charge_int_ |
| std::vector< float > | per_charge_snr_ |
| std::vector< float > | per_isotope_int_ |
| per isotope intensity. More... | |
| int | min_abs_charge_ = 0 |
| charge range More... | |
| int | max_abs_charge_ = -1 |
| uint | index_ = 0 |
| peak group index More... | |
| uint | findex_ = 0 |
| feature index in which this peak group is included. 0 if not included in any feature More... | |
| int | scan_number_ = 0 |
| scan number More... | |
| bool | is_positive_ = false |
| is positive or not More... | |
| bool | is_targeted_ = false |
| if this peak group has been targeted More... | |
| double | monoisotopic_mass_ = -1.0 |
| monoisotopic mass More... | |
| float | intensity_ = 0.f |
| summed intensity More... | |
| PeakGroup::TargetDecoyType | target_decoy_type_ = target |
| index to specify if this peak_group is a target, a noise, or a signal decoy. More... | |
| int | min_negative_isotope_index_ = -1 |
| double | iso_da_distance_ = Constants::ISOTOPE_MASSDIFF_55K_U |
| distance between consecutive isotopes. Can be different for decoys More... | |
| int | max_snr_abs_charge_ = -1 |
| float | isotope_cosine_score_ = 0.f |
| cosine score between averagine and the observed isotope pattern More... | |
| float | charge_score_ = 0.f |
| charge fit score More... | |
| double | qscore_ = .0 |
| quality score More... | |
| double | qscore2D_ = -1.0f |
| quality score when considering correlation between masses within the same feature. More... | |
| float | avg_ppm_error_ = 0.f |
| float | avg_da_error_ = 0.f |
| float | snr_ = 0.f |
| total SNR More... | |
| float | qvalue_ = 1.f |
| q value, only active when FDR report is activated. More... | |
Class describing a deconvolved mass. A mass contains multiple (LogMz) peaks of different charges and isotope indices. PeakGroup is the set of such peaks representing a single monoisotopic mass. PeakGroup also contains features that define the quality of it. It is used for PeakGroupScoring calculation. DeconvolvedSpectrum consists of PeakGroups.
|
private |
|
private |
| enum TargetDecoyType |
|
default |
default constructor
|
explicit |
Constructor specifying charge range.
| min_abs_charge | min Charge |
| max_abs_charge | max Charge |
| is_positive | whether MS is positive mode |
|
default |
default destructor
| FLASHHelperClasses::LogMzPeak& back | ( | ) |
|
noexcept |
iterators for the signal LogMz peaks in this PeakGroup
|
noexcept |
|
private |
clear peaks
| bool empty | ( | ) | const |
|
noexcept |
|
noexcept |
| std::tuple<int, int> getAbsChargeRange | ( | ) | const |
get charge range - the actual charge values
| float getAvgDaError | ( | ) | const |
get average mass ppm error;
| float getAvgPPMError | ( | ) | const |
get average mass ppm error;
| float getChargeIntensity | ( | int | abs_charge | ) | const |
get per abs_charge intenstiy
| float getChargeIsotopeCosine | ( | int | abs_charge | ) | const |
get per abs_charge isotope cosine
| float getChargeScore | ( | ) | const |
get charge score
| float getChargeSNR | ( | int | abs_charge | ) | const |
get per abs_charge SNR
|
private |
get Da error of a logMzPeak from the closest isotope
| std::tuple<std::vector<double>, std::vector<double> > getDLVector | ( | const MSSpectrum & | spec, |
| const Size | charge_count, | ||
| const Size | isotope_count, | ||
| const FLASHHelperClasses::PrecalculatedAveragine & | avg, | ||
| double | tol | ||
| ) |
Get deep learning feature vectors (signal and noise).
| spec | Raw spectrum to extract features from. |
| charge_count | Number of charges to include in the feature vector. |
| isotope_count | Number of isotopes to include in the feature vector. |
| avg | Precalculated averagine model for theoretical isotope patterns. |
| tol | Tolerance in ppm for peak matching. |
| uint getFeatureIndex | ( | ) | const |
Get the feature index associated with this peak group.
The feature index identifies which traced feature (isotope pattern across multiple scans) this peak group belongs to.
| uint getIndex | ( | ) | const |
get index of this peak group
| float getIntensity | ( | ) | const |
get intensity
| float getIsotopeCosine | ( | ) | const |
get isotopic cosine score
| double getIsotopeDaDistance | ( | ) | const |
get distance between consecutive isotopes
| const std::vector<float>& getIsotopeIntensities | ( | ) | const |
get per isotope intensities
| std::vector<float> getMassErrors | ( | bool | ppm = true | ) | const |
Get mass errors for each isotope index in this peak group.
Calculates the average mass error for peaks at each isotope index, comparing observed masses to theoretical masses from the averagine model.
| ppm | If true (default), returns errors in parts-per-million (ppm). If false, returns errors in Daltons (Da). |
| int getMinNegativeIsotopeIndex | ( | ) | const |
get minimum neagative isotope index
| double getMonoMass | ( | ) | const |
get monoisotopic mass
| std::tuple<double, double> getMzRange | ( | int | abs_charge | ) | const |
get mz range of the charge
|
private |
calculate noisy peak power. The goal of this function is to group noisy peaks that are possibly from the same molecule and sum their intensities before calculate power
| noisy_peaks | noisy peaks to calculate power |
| z | charge |
| tol | ppm tolerance |
| std::vector<LogMzPeak> getNoisyPeaks | ( | const MSSpectrum & | spec, |
| double | tol, | ||
| const FLASHHelperClasses::PrecalculatedAveragine & | avg | ||
| ) | const |
Get noisy peaks for this PeakGroup without modifying any state (const-safe). This is a const alternative to recruitAllPeaksInSpectrum(..., false) for use in output/write functions.
| spec | raw spectrum |
| tol | ppm tolerance |
| avg | precalculated averagine |
| float getPeakOccupancy | ( | ) | const |
get the density of the peaks within charge and isotope range
Get the density of peaks within charge and isotope range.
|
private |
calculate per isotope intensities. When abs_charge == 0, all peaks are considered
|
private |
update avg Da error
| double getQscore | ( | ) | const |
Get the one-dimensional quality score for this peak group.
The Q-score represents the confidence/quality of the peak group based on isotope pattern matching, charge state consistency, and signal-to-noise ratio.
| double getQscore2D | ( | ) | const |
Get the two-dimensional quality score incorporating feature-level information.
The 2D Q-score extends the 1D score by incorporating additional dimensions such as retention time consistency, ion mobility correlation, or MS1-MS2 relationship. This score is typically set after feature tracing/grouping across scans.
| float getQvalue | ( | ) | const |
Get q value
| int getRepAbsCharge | ( | ) | const |
get representative charge
| std::tuple<double, double> getRepMzRange | ( | ) | const |
get mz range that results in max setQscore
| int getScanNumber | ( | ) | const |
get scan number
| float getSNR | ( | ) | const |
get total SNR
| PeakGroup::TargetDecoyType getTargetDecoyType | ( | ) | const |
get the target decoy type of this
| bool isPositive | ( | ) | const |
get if it is positive mode
| bool isTargeted | ( | ) | const |
get if it is targeted
| bool operator< | ( | const PeakGroup & | a | ) | const |
comparison operators
| bool operator== | ( | const PeakGroup & | a | ) | const |
| bool operator> | ( | const PeakGroup & | a | ) | const |
| const FLASHHelperClasses::LogMzPeak& operator[] | ( | Size | i | ) | const |
| void push_back | ( | const FLASHHelperClasses::LogMzPeak & | pg | ) |
vector operators for the LogMzPeaks in this PeakGroup
| std::vector<LogMzPeak> recruitAllPeaksInSpectrum | ( | const MSSpectrum & | spec, |
| double | tol, | ||
| const FLASHHelperClasses::PrecalculatedAveragine & | avg, | ||
| double | mono_mass, | ||
| bool | renew_signal_peaks = true |
||
| ) |
given a monoisotopic mass, recruit raw peaks from the raw input spectrum and add to this peakGroup. This is a bit time-consuming and is done for only a small number of selected high-quality peakgroups.
| spec | raw spectrum |
| tol | ppm tolerance |
| avg | precalculated averagine |
| mono_mass | monoisotopic mass |
| renew_signal_peaks | Whether or not the signal peaks should be renewed during recruitment |
| void reserve | ( | Size | n | ) |
| void setAbsChargeRange | ( | int | min_abs_charge, |
| int | max_abs_charge | ||
| ) |
set min_abs_charge and max_abs_charge charge range
| void setAvgPPMError | ( | float | error | ) |
set average mass ppm error
| void setChargeIsotopeCosine | ( | int | abs_charge, |
| float | cos | ||
| ) |
set per abs_charge isotope cosine
| void setChargeScore | ( | float | charge_score | ) |
set charge score - for FLASHIda log file parsing
| void setChargeSNR | ( | int | abs_charge, |
| float | c_snr | ||
| ) |
set charge SNR manually - for FLASHIda log file parsing
| void setFeatureIndex | ( | uint | findex | ) |
Set the feature index for this peak group.
Associates this peak group with a feature (traced isotope pattern across scans).
| findex | The feature index to assign to this peak group. |
| void setIndex | ( | uint | i | ) |
set index of this peak group
| void setIsotopeCosine | ( | float | cos | ) |
set isotope cosine score
| void setIsotopeDaDistance | ( | double | d | ) |
set distance between consecutive isotopes
| void setMonoisotopicMass | ( | double | mono_mass | ) |
set monoisotopic mass
| void setQscore | ( | double | qscore | ) |
set Qscore - for FLASHIda log file parsing
| void setQscore2D | ( | double | fqscore | ) |
Set the two-dimensional quality score for this peak group.
The 2D Q-score incorporates feature-level information such as retention time consistency or ion mobility correlation across multiple scans.
| fqscore | The 2D quality score to set, typically in range [0, 1]. |
| void setQvalue | ( | double | q | ) |
set peakGroup q value
| void setRepAbsCharge | ( | int | max_snr_abs_charge | ) |
set representative max_snr_abs_charge
| void setScanNumber | ( | int | scan_number | ) |
set scan number
| void setSNR | ( | float | snr | ) |
set SNR manually - for FLASHIda log file parsing
| void setTargetDecoyType | ( | PeakGroup::TargetDecoyType | index | ) |
for this PeakGroup, specify the target decoy type.
| void setTargeted | ( | ) |
set if it is targeted
|
noexcept |
| void sort | ( | ) |
| void swap | ( | std::vector< FLASHHelperClasses::LogMzPeak > & | x | ) |
|
private |
update avg ppm error
|
private |
update chargefit score and also update per charge intensities here.
|
private |
update the charge range using the calculated per charge information
| void updateMonoMassAndIsotopeIntensities | ( | double | tol | ) |
add monoisotopic indices of peaks by offset and discard negative isotope peaks. Total intensity is also updated
|
private |
update per charge cosine values
|
private |
update per charge intensities, noise power, and squared intensities. used for SNR estimation
| int updateQscore | ( | const std::vector< LogMzPeak > & | noisy_peaks, |
| const FLASHHelperClasses::PrecalculatedAveragine & | avg, | ||
| double | min_cos, | ||
| double | tol, | ||
| bool | is_low_charge, | ||
| const std::vector< double > & | excluded_masses, | ||
| bool | is_last = false |
||
| ) |
Update setQscore. Cosine and SNRs are also updated.
| noisy_peaks | noisy peaks to calculate setQscore |
| avg | precalculated averagine |
| min_cos | the peak groups with cosine score less than this will have setQscore 0. |
| tol | ppm tolerance |
| is_low_charge | if set, charge fit score calculation becomes less stroct |
| excluded_masses | masses to exclude |
| is_last | if this is set, it means that PeakGroupScoring calculation is at its last iteration. More detailed noise power calculation is activated and mono mass is not recalibrated. |
|
private |
using signal and total (signal + noise) power, update SNR value
|
private |
|
private |
|
private |
charge fit score
|
private |
feature index in which this peak group is included. 0 if not included in any feature
|
private |
peak group index
|
private |
summed intensity
|
private |
is positive or not
|
private |
if this peak group has been targeted
|
private |
distance between consecutive isotopes. Can be different for decoys
|
private |
cosine score between averagine and the observed isotope pattern
|
private |
log Mz peaks
|
private |
|
private |
scoring variables the charge for which the charge SNR is maximized
|
private |
charge range
|
private |
up to which negative isotope index should be considered for isotope pattern matching. By considering negative isotopes, one can reduce isotope index error.
|
private |
monoisotopic mass
|
private |
negative isotope index peaks
|
private |
|
private |
|
private |
|
private |
|
private |
per charge summed signal squared, noise pwr, SNR, isotope cosine, and intensity vectors
|
private |
per isotope intensity.
|
private |
quality score when considering correlation between masses within the same feature.
|
private |
quality score
|
private |
q value, only active when FDR report is activated.
|
private |
scan number
|
private |
total SNR
|
private |
index to specify if this peak_group is a target, a noise, or a signal decoy.