OpenMS  3.0.0
PeakGroup Class Reference

Class describing a deconvolved mass. A mass contains multiple 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>

Collaboration diagram for PeakGroup:
[legend]

Public Member Functions

 PeakGroup ()=default
 default constructor More...
 
 PeakGroup (const int min_abs_charge, const int max_abs_charge, const bool is_positive)
 Constructor specifying charge range. More...
 
 ~PeakGroup ()
 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
 
PeakGroupoperator= (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...
 
void updateIsotopeCosineAndQScore (const FLASHDeconvHelperStructs::PrecalculatedAveragine &avg, double min_cos, double iso_da_distance)
 
void recruitAllPeaksInSpectrum (const MSSpectrum &spec, const double tol, const FLASHDeconvHelperStructs::PrecalculatedAveragine &avg, double mono_mass, bool write_detail)
 recruit peaks and then return as a spectrum. More...
 
void updateSNR ()
 using signal and total (signal + noise) power, update SNR value More...
 
bool isSignalMZ (const double mz, const 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) More...
 
void setScanNumber (const int scan_number)
 set scan number More...
 
void setChargeIsotopeCosine (const int abs_charge, const float cos)
 set per abs_charge isotope cosine More...
 
void setMaxQScoreMzRange (const double min, const double max)
 set mz range that results in max QScore More...
 
void setAbsChargeRange (const int min_abs_charge, const int max_abs_charge)
 set min_abs_charge and max_abs_charge charge range More...
 
void setIsotopeCosine (const float cos)
 set isotope cosine score More...
 
void setRepAbsCharge (const int max_qscore_charge)
 set representative max_qscore_charge More...
 
void setQScore (const float qscore)
 set Q score - for FLASHIda log file parsing More...
 
void setChargeScore (const float charge_score)
 set charge score - for FLASHIda log file parsing More...
 
void setAvgPPMError (const float error)
 set average mass ppm error More...
 
void setSNR (const float snr)
 set SNR manually - for FLASHIda log file parsing More...
 
void setChargeSNR (const int abs_charge, const float c_snr)
 set charge SNR manually - for FLASHIda log file parsing More...
 
void setTargeted ()
 set if it is targeted More...
 
void setSecondBestMonsMass (const double mass)
 set second best monoisotopic mass More...
 
int getScanNumber () const
 get scan number More...
 
double getMonoMass () const
 get monoisotopic mass More...
 
double getSecondBestMonoMass () const
 get second best monoisotopic mass More...
 
double getIntensity () const
 get intensity More...
 
float getChargeSNR (const int abs_charge) const
 get per abs_charge SNR More...
 
float getChargeIsotopeCosine (const int abs_charge) const
 get per abs_charge isotope cosine More...
 
float getChargeIntensity (const int abs_charge) const
 get per abs_charge intenstiy More...
 
std::tuple< double, double > getMaxQScoreMzRange () 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...
 
std::vector< float > getIsotopeIntensities () const
 
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...
 
bool isPositive () const
 get if it is positive mode More...
 
bool isTargeted () const
 get if it is targeted More...
 
int getDecoyIndex () const
 
void setDecoyIndex (int index)
 
float getQvalue () const
 
void setQvalue (const float q)
 
float getQvalueWithChargeDecoyOnly () const
 
float getQvalueWithIsotopeDecoyOnly () const
 
float getQvalueWithNoiseDecoyOnly () const
 
void setQvalueWithChargeDecoyOnly (const float q)
 
void setQvalueWithIsotopeDecoyOnly (const float q)
 
void setQvalueWithNoiseDecoyOnly (const float q)
 
void setIsotopeDaDistance (const double d)
 
double getIsotopeDaDistance () const
 
std::vector< FLASHDeconvHelperStructs::LogMzPeak >::const_iterator begin () const noexcept
 
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::LogMzPeakoperator[] (const Size i) const
 
void push_back (const FLASHDeconvHelperStructs::LogMzPeak &pg)
 
Size size () const noexcept
 
void clear ()
 
void reserve (Size n)
 
bool empty () const
 
void swap (std::vector< FLASHDeconvHelperStructs::LogMzPeak > &x)
 
void shrink_to_fit ()
 
void sort ()
 

Public Attributes

std::vector< FLASHDeconvHelperStructs::LogMzPeaknoisy_peaks
 

Private Types

typedef FLASHDeconvHelperStructs::LogMzPeak LogMzPeak
 
typedef FLASHDeconvHelperStructs::PrecalculatedAveragine PrecalculatedAveragine
 

Private Member Functions

void setChargePowers_ (const int abs_charge, const double signal_pwr, const double noise_pwr, const double intensity)
 set per abs_charge signal power More...
 
void updateChargeFitScoreAndChargeIntensities_ ()
 
void updateAvgPPMError_ (double iso_da_distance)
 

Private Attributes

std::vector< FLASHDeconvHelperStructs::LogMzPeaklogMzpeaks_
 log Mz peaks More...
 
std::vector< float > per_charge_signal_pwr_
 per charge SNR, isotope cosine, and intensity vectors More...
 
std::vector< float > per_charge_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...
 
double max_qscore_mz_end_
 mz range resulting in maximum Q score More...
 
double max_qscore_mz_start_
 
int min_abs_charge_ = 0
 charge range More...
 
int max_abs_charge_ = -1
 
int scan_number_
 scan number More...
 
bool is_positive_
 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...
 
double second_best_monomass_ = -1.0
 
double intensity_
 
int decoy_index_ = 0
 index to specify if this peak_group is a target (0), an isotope decoy (1), a noise (2), or a charge decoy (3) More...
 
double iso_da_distance_ = Constants::ISOTOPE_MASSDIFF_55K_U
 distance between consecutive isotopes. Can be different for decoys More...
 
int max_qscore_abs_charge_ = -1
 scoring variables More...
 
float isotope_cosine_score_ = 0
 
float charge_score_
 
float qscore_ = .0f
 
float avg_ppm_error_ = 0
 
float snr_ = 0
 
float qvalue_ = 1.0
 
float qvalue_with_isotope_decoy_only_ = 1.0
 
float qvalue_with_noise_decoy_only_ = 1.0
 
float qvalue_with_charge_decoy_only_ = 1.0
 

Detailed Description

Class describing a deconvolved mass. A mass contains multiple 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.

Member Typedef Documentation

◆ LogMzPeak

◆ PrecalculatedAveragine

Constructor & Destructor Documentation

◆ PeakGroup() [1/4]

PeakGroup ( )
default

default constructor

◆ PeakGroup() [2/4]

PeakGroup ( const int  min_abs_charge,
const int  max_abs_charge,
const bool  is_positive 
)
explicit

Constructor specifying charge range.

Parameters
min_abs_chargemin Charge
max_abs_chargemax Charge
is_positivewhether MS is positive mode

◆ ~PeakGroup()

~PeakGroup ( )

default destructor

◆ PeakGroup() [3/4]

PeakGroup ( const PeakGroup )
default

copy constructor

◆ PeakGroup() [4/4]

PeakGroup ( PeakGroup &&  other)
default

move constructor

Member Function Documentation

◆ begin() [1/2]

std::vector<FLASHDeconvHelperStructs::LogMzPeak>::const_iterator begin ( ) const
noexcept

◆ begin() [2/2]

std::vector<FLASHDeconvHelperStructs::LogMzPeak>::iterator begin ( )
noexcept

◆ clear()

void clear ( )

◆ empty()

bool empty ( ) const

◆ end() [1/2]

std::vector<FLASHDeconvHelperStructs::LogMzPeak>::const_iterator end ( ) const
noexcept

◆ end() [2/2]

std::vector<FLASHDeconvHelperStructs::LogMzPeak>::iterator end ( )
noexcept

◆ getAbsChargeRange()

std::tuple<int, int> getAbsChargeRange ( ) const

get charge range - the actual charge values

◆ getAvgPPMError()

float getAvgPPMError ( ) const

get average mass ppm error;

◆ getChargeIntensity()

float getChargeIntensity ( const int  abs_charge) const

get per abs_charge intenstiy

◆ getChargeIsotopeCosine()

float getChargeIsotopeCosine ( const int  abs_charge) const

get per abs_charge isotope cosine

◆ getChargeScore()

float getChargeScore ( ) const

get charge score

◆ getChargeSNR()

float getChargeSNR ( const int  abs_charge) const

get per abs_charge SNR

◆ getDecoyIndex()

int getDecoyIndex ( ) const

◆ getIntensity()

double getIntensity ( ) const

get intensity

◆ getIsotopeCosine()

float getIsotopeCosine ( ) const

get isotopic cosine score

◆ getIsotopeDaDistance()

double getIsotopeDaDistance ( ) const

◆ getIsotopeIntensities()

std::vector<float> getIsotopeIntensities ( ) const

◆ getMaxQScoreMzRange()

std::tuple<double, double> getMaxQScoreMzRange ( ) const

get mz range that results in max QScore

◆ getMonoMass()

double getMonoMass ( ) const

get monoisotopic mass

◆ getMzRange()

std::tuple<double, double> getMzRange ( int  abs_charge) const

get mz range of the charge

◆ getQScore()

float getQScore ( ) const

get Q score

◆ getQvalue()

float getQvalue ( ) const

◆ getQvalueWithChargeDecoyOnly()

float getQvalueWithChargeDecoyOnly ( ) const

◆ getQvalueWithIsotopeDecoyOnly()

float getQvalueWithIsotopeDecoyOnly ( ) const

◆ getQvalueWithNoiseDecoyOnly()

float getQvalueWithNoiseDecoyOnly ( ) const

◆ getRepAbsCharge()

int getRepAbsCharge ( ) const

get representative charge

◆ getScanNumber()

int getScanNumber ( ) const

get scan number

◆ getSecondBestMonoMass()

double getSecondBestMonoMass ( ) const

get second best monoisotopic mass

◆ getSNR()

float getSNR ( ) const

get total SNR

◆ isPositive()

bool isPositive ( ) const

get if it is positive mode

◆ isSignalMZ()

bool isSignalMZ ( const double  mz,
const 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)

◆ isTargeted()

bool isTargeted ( ) const

get if it is targeted

◆ operator<()

bool operator< ( const PeakGroup a) const

comparison operators

◆ operator=()

PeakGroup& operator= ( const PeakGroup t)
default

assignment operator

◆ operator==()

bool operator== ( const PeakGroup a) const

◆ operator>()

bool operator> ( const PeakGroup a) const

◆ operator[]()

const FLASHDeconvHelperStructs::LogMzPeak& operator[] ( const Size  i) const

◆ push_back()

void push_back ( const FLASHDeconvHelperStructs::LogMzPeak pg)

◆ recruitAllPeaksInSpectrum()

void recruitAllPeaksInSpectrum ( const MSSpectrum spec,
const double  tol,
const FLASHDeconvHelperStructs::PrecalculatedAveragine avg,
double  mono_mass,
bool  write_detail 
)

recruit peaks and then return as a spectrum.

◆ reserve()

void reserve ( Size  n)

◆ setAbsChargeRange()

void setAbsChargeRange ( const int  min_abs_charge,
const int  max_abs_charge 
)

set min_abs_charge and max_abs_charge charge range

◆ setAvgPPMError()

void setAvgPPMError ( const float  error)

set average mass ppm error

◆ setChargeIsotopeCosine()

void setChargeIsotopeCosine ( const int  abs_charge,
const float  cos 
)

set per abs_charge isotope cosine

◆ setChargePowers_()

void setChargePowers_ ( const int  abs_charge,
const double  signal_pwr,
const double  noise_pwr,
const double  intensity 
)
private

set per abs_charge signal power

◆ setChargeScore()

void setChargeScore ( const float  charge_score)

set charge score - for FLASHIda log file parsing

◆ setChargeSNR()

void setChargeSNR ( const int  abs_charge,
const float  c_snr 
)

set charge SNR manually - for FLASHIda log file parsing

◆ setDecoyIndex()

void setDecoyIndex ( int  index)

◆ setIsotopeCosine()

void setIsotopeCosine ( const float  cos)

set isotope cosine score

◆ setIsotopeDaDistance()

void setIsotopeDaDistance ( const double  d)

◆ setMaxQScoreMzRange()

void setMaxQScoreMzRange ( const double  min,
const double  max 
)

set mz range that results in max QScore

◆ setQScore()

void setQScore ( const float  qscore)

set Q score - for FLASHIda log file parsing

◆ setQvalue()

void setQvalue ( const float  q)

◆ setQvalueWithChargeDecoyOnly()

void setQvalueWithChargeDecoyOnly ( const float  q)

◆ setQvalueWithIsotopeDecoyOnly()

void setQvalueWithIsotopeDecoyOnly ( const float  q)

◆ setQvalueWithNoiseDecoyOnly()

void setQvalueWithNoiseDecoyOnly ( const float  q)

◆ setRepAbsCharge()

void setRepAbsCharge ( const int  max_qscore_charge)

set representative max_qscore_charge

◆ setScanNumber()

void setScanNumber ( const int  scan_number)

set scan number

◆ setSecondBestMonsMass()

void setSecondBestMonsMass ( const double  mass)

set second best monoisotopic mass

◆ setSNR()

void setSNR ( const float  snr)

set SNR manually - for FLASHIda log file parsing

◆ setTargeted()

void setTargeted ( )

set if it is targeted

◆ shrink_to_fit()

void shrink_to_fit ( )

◆ size()

Size size ( ) const
noexcept

◆ sort()

void sort ( )

◆ swap()

void swap ( std::vector< FLASHDeconvHelperStructs::LogMzPeak > &  x)

◆ updateAvgPPMError_()

void updateAvgPPMError_ ( double  iso_da_distance)
private

◆ updateChargeFitScoreAndChargeIntensities_()

void updateChargeFitScoreAndChargeIntensities_ ( )
private

◆ updateIsotopeCosineAndQScore()

void updateIsotopeCosineAndQScore ( const FLASHDeconvHelperStructs::PrecalculatedAveragine avg,
double  min_cos,
double  iso_da_distance 
)

◆ updateMonomassAndIsotopeIntensities()

void updateMonomassAndIsotopeIntensities ( )

add monoisotopic indices of peaks by offset and discard negative isotope peaks. Total intensity is also updated

Parameters
offsetisotope index offset

◆ updateSNR()

void updateSNR ( )

using signal and total (signal + noise) power, update SNR value

Member Data Documentation

◆ avg_ppm_error_

float avg_ppm_error_ = 0
private

◆ charge_score_

float charge_score_
private

◆ decoy_index_

int decoy_index_ = 0
private

index to specify if this peak_group is a target (0), an isotope decoy (1), a noise (2), or a charge decoy (3)

◆ intensity_

double intensity_
private

◆ is_positive_

bool is_positive_
private

is positive or not

◆ is_targeted_

bool is_targeted_ = false
private

if this peak group has been targeted

◆ iso_da_distance_

double iso_da_distance_ = Constants::ISOTOPE_MASSDIFF_55K_U
private

distance between consecutive isotopes. Can be different for decoys

◆ isotope_cosine_score_

float isotope_cosine_score_ = 0
private

◆ logMzpeaks_

std::vector<FLASHDeconvHelperStructs::LogMzPeak> logMzpeaks_
private

log Mz peaks

◆ max_abs_charge_

int max_abs_charge_ = -1
private

◆ max_qscore_abs_charge_

int max_qscore_abs_charge_ = -1
private

scoring variables

◆ max_qscore_mz_end_

double max_qscore_mz_end_
private

mz range resulting in maximum Q score

◆ max_qscore_mz_start_

double max_qscore_mz_start_
private

◆ min_abs_charge_

int min_abs_charge_ = 0
private

charge range

◆ monoisotopic_mass_

double monoisotopic_mass_ = -1.0
private

information on the deconvolved mass

◆ noisy_peaks

std::vector<FLASHDeconvHelperStructs::LogMzPeak> noisy_peaks

◆ per_charge_cos_

std::vector<float> per_charge_cos_
private

◆ per_charge_int_

std::vector<float> per_charge_int_
private

◆ per_charge_pwr_

std::vector<float> per_charge_pwr_
private

◆ per_charge_signal_pwr_

std::vector<float> per_charge_signal_pwr_
private

per charge SNR, isotope cosine, and intensity vectors

◆ per_charge_snr_

std::vector<float> per_charge_snr_
private

◆ per_isotope_int_

std::vector<float> per_isotope_int_
private

per isotope intensity.

◆ qscore_

float qscore_ = .0f
private

◆ qvalue_

float qvalue_ = 1.0
private

◆ qvalue_with_charge_decoy_only_

float qvalue_with_charge_decoy_only_ = 1.0
private

◆ qvalue_with_isotope_decoy_only_

float qvalue_with_isotope_decoy_only_ = 1.0
private

◆ qvalue_with_noise_decoy_only_

float qvalue_with_noise_decoy_only_ = 1.0
private

◆ scan_number_

int scan_number_
private

scan number

◆ second_best_monomass_

double second_best_monomass_ = -1.0
private

◆ snr_

float snr_ = 0
private