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 by Qscore calculation. DeconvolvedSpectrum consists of PeakGroups. More...
#include <OpenMS/ANALYSIS/TOPDOWN/PeakGroup.h>
Public Types | |
enum | TargetDummyType { target = 0 , charge_dummy , noise_dummy , isotope_dummy } |
target dummy type of PeakGroup. This specifies if a PeakGroup is a target (0), charge dummy (1), noise dummy (2), or isotope dummy (3). More... | |
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 () |
add monoisotopic indices of peaks by offset and discard negative isotope peaks. Total intensity is also updated More... | |
int | updateQscore (std::vector< LogMzPeak > &noisy_peaks, const FLASHDeconvHelperStructs::PrecalculatedAveragine &avg, double min_cos, int allowed_iso_error=1) |
Update Qscore. Cosine and SNRs are also updated. More... | |
std::vector< LogMzPeak > | recruitAllPeaksInSpectrum (const MSSpectrum &spec, double tol, const FLASHDeconvHelperStructs::PrecalculatedAveragine &avg, double mono_mass, const std::unordered_set< double > &excluded_peak_mzs) |
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... | |
bool | isSignalMZ (double mz, double tol) const |
determine is an mz is a signal of this peakgroup. Input tol is ppm tolerance (e.g., 10.0 for 10ppm tolerance). Assume logMzPeaks are sorted. 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 | Qscore (float qscore) |
set Q score - 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 Qscore 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... | |
int | getRepAbsCharge () const |
get representative charge More... | |
float | getQscore () const |
get Q score 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::TargetDummyType | getTargetDummyType () const |
get the target dummy type of this More... | |
void | setTargetDummyType (PeakGroup::TargetDummyType index) |
for this PeakGroup, specify the target dummy type. More... | |
float | getQvalue (PeakGroup::TargetDummyType target_dummy_type=PeakGroup::TargetDummyType::target) const |
void | setQvalue (float q, PeakGroup::TargetDummyType target_dummy_type) |
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... | |
uint | getIndex () const |
get index of this peak group More... | |
std::vector< FLASHDeconvHelperStructs::LogMzPeak >::const_iterator | begin () const noexcept |
iterators for the signal LogMz peaks in this PeakGroup More... | |
std::vector< FLASHDeconvHelperStructs::LogMzPeak >::const_iterator | end () const noexcept |
std::vector< FLASHDeconvHelperStructs::LogMzPeak >::iterator | begin () noexcept |
std::vector< FLASHDeconvHelperStructs::LogMzPeak >::iterator | end () noexcept |
const FLASHDeconvHelperStructs::LogMzPeak & | operator[] (Size i) const |
std::vector< FLASHDeconvHelperStructs::LogMzPeak >::const_iterator | getNoisePeakBegin () const noexcept |
iterators for the noisy LogMz peaks in this PeakGroup More... | |
std::vector< FLASHDeconvHelperStructs::LogMzPeak >::const_iterator | getNoisePeakEnd () const noexcept |
std::vector< FLASHDeconvHelperStructs::LogMzPeak >::iterator | getNoisePeakBegin () noexcept |
std::vector< FLASHDeconvHelperStructs::LogMzPeak >::iterator | getNoisePeakEnd () noexcept |
void | push_back (const FLASHDeconvHelperStructs::LogMzPeak &pg) |
vector operators for the LogMzPeaks in this PeakGroup More... | |
Size | size () const noexcept |
void | reserve (Size n) |
bool | empty () const |
void | swap (std::vector< FLASHDeconvHelperStructs::LogMzPeak > &x) |
void | sort () |
Private Types | |
typedef FLASHDeconvHelperStructs::LogMzPeak | LogMzPeak |
typedef FLASHDeconvHelperStructs::PrecalculatedAveragine | PrecalculatedAveragine |
Private Member Functions | |
void | updateChargeFitScoreAndChargeIntensities_ () |
update chargefit score and also update per charge intensities here. More... | |
void | updateAvgPPMError_ () |
update avg ppm error More... | |
void | updateAvgDaError_ () |
update avg Da error More... | |
float | getAbsPPMError_ (const LogMzPeak &p) const |
get ppm error of a logMzPeak More... | |
float | getAbsDaError_ (LogMzPeak &p) const |
get Da error of a logMzPeak from the closest isotope More... | |
void | updateSNR_ () |
using signal and total (signal + noise) power, update SNR value More... | |
void | clear_ () |
clear peaks More... | |
void | updatePerChargeInformation_ (const std::vector< LogMzPeak > &noisy_peaks) |
update per charge intensities, noise power, and squared intensities. used for SNR estimation More... | |
void | updateChargeRange_ (std::vector< LogMzPeak > &noisy_peaks) |
update the charge range using the calculated per charge information More... | |
void | updatePerChargeCos_ (const FLASHDeconvHelperStructs::PrecalculatedAveragine &avg) |
update per charge cosine values More... | |
float | getNoisePeakPower_ (const std::vector< LogMzPeak > &noisy_peaks, const std::vector< LogMzPeak > &signal_peaks) const |
Private Attributes | |
std::vector< FLASHDeconvHelperStructs::LogMzPeak > | logMzpeaks_ |
log Mz peaks More... | |
std::vector< FLASHDeconvHelperStructs::LogMzPeak > | negative_iso_peaks_ |
negative isotope index peaks More... | |
std::vector< float > | per_charge_sum_signal_squared_ |
per charge 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... | |
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 |
information on the deconvolved mass More... | |
float | intensity_ = 0 |
PeakGroup::TargetDummyType | target_dummy_type_ = target |
index to specify if this peak_group is a target (0), an isotope dummy (1), a noise (2), or a charge dummy (3) More... | |
int | min_negative_isotope_index_ = -1 |
up to which negative isotope index should be considered. By considereing negative istoopes, one can reduce isotope index error. More... | |
double | iso_da_distance_ = Constants::ISOTOPE_MASSDIFF_55K_U |
distance between consecutive isotopes. Can be different for dummys More... | |
int | max_snr_abs_charge_ = -1 |
scoring variables More... | |
float | isotope_cosine_score_ = 0 |
float | charge_score_ = 0 |
float | qscore_ = .0f |
float | avg_ppm_error_ = 0 |
float | avg_da_error_ = 0 |
float | snr_ = 0 |
std::map< PeakGroup::TargetDummyType, float > | qvalue_ |
q values with different dummy types 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 by Qscore calculation. DeconvolvedSpectrum consists of PeakGroups.
|
private |
enum TargetDummyType |
|
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
|
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
|
private |
get Da error of a logMzPeak from the closest isotope
|
private |
get ppm error of a logMzPeak
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
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
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
|
noexcept |
iterators for the noisy LogMz peaks in this PeakGroup
|
noexcept |
|
noexcept |
|
noexcept |
|
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 |
signal_peaks | signal peaks - they may make a part of noisy isotopes |
float getQscore | ( | ) | const |
get Q score
float getQvalue | ( | PeakGroup::TargetDummyType | target_dummy_type = PeakGroup::TargetDummyType::target | ) | const |
Get q values for different target_dummy_type. For charge, noise, isotope dummy types, q values corresponding to the type will be returned. For target (default), the final q value is calculated by summing the q values of all dummy types and returned.
target_dummy_type | This target_dummy_type_ specifies if a PeakGroup is a target (0), charge dummy (1), noise dummy (2), or isotope dummy (3) |
int getRepAbsCharge | ( | ) | const |
get representative charge
std::tuple<double, double> getRepMzRange | ( | ) | const |
get mz range that results in max Qscore
int getScanNumber | ( | ) | const |
get scan number
float getSNR | ( | ) | const |
get total SNR
PeakGroup::TargetDummyType getTargetDummyType | ( | ) | const |
get the target dummy type of this
bool isPositive | ( | ) | const |
get if it is positive mode
bool isSignalMZ | ( | double | mz, |
double | tol | ||
) | const |
determine is an mz is a signal of this peakgroup. Input tol is ppm tolerance (e.g., 10.0 for 10ppm tolerance). Assume logMzPeaks are sorted.
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 FLASHDeconvHelperStructs::LogMzPeak& operator[] | ( | Size | i | ) | const |
void push_back | ( | const FLASHDeconvHelperStructs::LogMzPeak & | pg | ) |
vector operators for the LogMzPeaks in this PeakGroup
Referenced by TOPPFLASHDeconv::main_().
void Qscore | ( | float | qscore | ) |
set Q score - for FLASHIda log file parsing
Referenced by TOPPFLASHDeconv::main_().
std::vector<LogMzPeak> recruitAllPeaksInSpectrum | ( | const MSSpectrum & | spec, |
double | tol, | ||
const FLASHDeconvHelperStructs::PrecalculatedAveragine & | avg, | ||
double | mono_mass, | ||
const std::unordered_set< double > & | excluded_peak_mzs | ||
) |
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 | mass tolerance |
avg | precalculated averagine |
mono_mass | monoisotopic mass |
excluded_peak_mzs | mzs that will be included - only for dummy generation |
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
Referenced by TOPPFLASHDeconv::main_().
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
Referenced by TOPPFLASHDeconv::main_().
void setQvalue | ( | float | q, |
PeakGroup::TargetDummyType | target_dummy_type | ||
) |
Set peakGroup q-value for different TargetDummyType. Q values are stored per TargetDummyType and later used for final q value calculation.
q | The q-value |
target_dummy_type | This target_dummy_type_ specifies if a PeakGroup is a target (0), charge dummy (1), noise dummy (2), or isotope dummy (3) |
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
Referenced by TOPPFLASHDeconv::main_().
void setTargetDummyType | ( | PeakGroup::TargetDummyType | index | ) |
for this PeakGroup, specify the target dummy type.
void setTargeted | ( | ) |
set if it is targeted
|
noexcept |
void sort | ( | ) |
void swap | ( | std::vector< FLASHDeconvHelperStructs::LogMzPeak > & | x | ) |
|
private |
update avg Da error
|
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 | ( | ) |
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 | ( | std::vector< LogMzPeak > & | noisy_peaks, |
const FLASHDeconvHelperStructs::PrecalculatedAveragine & | avg, | ||
double | min_cos, | ||
int | allowed_iso_error = 1 |
||
) |
Update Qscore. Cosine and SNRs are also updated.
noisy_peaks | noisy peaks to calculate Qscore |
avg | precalculated averagine |
min_cos | the peak groups with cosine score less than this will have Qscore 0. |
allowed_iso_error | this set the allowed isotope error in dummy mass generation. |
|
private |
using signal and total (signal + noise) power, update SNR value
|
private |
|
private |
|
private |
|
private |
peak group index
|
private |
|
private |
is positive or not
|
private |
if this peak group has been targeted
|
private |
distance between consecutive isotopes. Can be different for dummys
|
private |
|
private |
log Mz peaks
|
private |
|
private |
scoring variables
|
private |
charge range
|
private |
up to which negative isotope index should be considered. By considereing negative istoopes, one can reduce isotope index error.
|
private |
information on the deconvolved mass
|
private |
negative isotope index peaks
|
private |
|
private |
|
private |
|
private |
|
private |
per charge SNR, isotope cosine, and intensity vectors
|
private |
per isotope intensity.
|
private |
|
private |
q values with different dummy types
|
private |
scan number
|
private |
|
private |
index to specify if this peak_group is a target (0), an isotope dummy (1), a noise (2), or a charge dummy (3)