![]() |
OpenMS
3.0.0
|
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 | DecoyFlag { target = 0, charge_decoy, noise_decoy, isotope_decoy } |
decoy flag. This flag specifies if a PeakGroup is a target, charge decoy, noise decoy, or isotope decoy. 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... | |
void | updateIsotopeCosineSNRAvgErrorAndQScore (const FLASHDeconvHelperStructs::PrecalculatedAveragine &avg, double min_cos) |
Update isotope cosine sore and qscore. Mono mass is also updated one last time. SNR, per charge SNR, and avg errors are updated here. More... | |
std::vector< LogMzPeak > | recruitAllPeaksInSpectrum (const MSSpectrum &spec, double tol, const FLASHDeconvHelperStructs::PrecalculatedAveragine &avg, double mono_mass, const std::unordered_set< int > &excluded_integer_mzs_, int charge_offset=0, double charge_multiple=1.0, double mz_off=.0) |
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_qscore_charge) |
set representative max_qscore_charge More... | |
void | setQScore (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::DecoyFlag | getDecoyFlag () const |
get the decoy flag of this More... | |
void | setDecoyFlag (PeakGroup::DecoyFlag index) |
for this PeakGroup, specify the decoy flag. More... | |
float | getQvalue (PeakGroup::DecoyFlag flag=PeakGroup::DecoyFlag::target) const |
get calculated qvalue More... | |
void | setQvalue (float q, PeakGroup::DecoyFlag flag) |
set qvalue. More... | |
void | setIsotopeDaDistance (double d) |
set distance between consecutive isotopes More... | |
double | getIsotopeDaDistance () const |
get distance between consecutive isotopes 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 |
void | push_back (const FLASHDeconvHelperStructs::LogMzPeak &pg) |
vector operators for the LogMzPeaks in this PeakGroup More... | |
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 () |
Private Types | |
typedef FLASHDeconvHelperStructs::LogMzPeak | LogMzPeak |
typedef FLASHDeconvHelperStructs::PrecalculatedAveragine | PrecalculatedAveragine |
Private Member Functions | |
void | setChargePowers_ (int abs_charge, float signal_pwr, float noise_pwr, float intensity) |
set per abs_charge signal power More... | |
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... | |
Private Attributes | |
std::vector< Matrix< float > > | dl_matrices_ |
Encoded matrix for DL scoring. More... | |
std::vector< FLASHDeconvHelperStructs::LogMzPeak > | logMzpeaks_ |
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_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_ |
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... | |
float | intensity_ |
PeakGroup::DecoyFlag | decoy_flag_ = target |
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 | avg_da_error_ = 0 |
float | snr_ = 0 |
std::map< PeakGroup::DecoyFlag, float > | qvalue_ |
qvalues with different decoy flags 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 DecoyFlag |
decoy flag. This flag specifies if a PeakGroup is a target, charge decoy, noise decoy, or isotope decoy.
Enumerator | |
---|---|
target | |
charge_decoy | |
noise_decoy | |
isotope_decoy |
|
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 |
void clear | ( | ) |
bool empty | ( | ) | const |
|
noexcept |
|
noexcept |
std::tuple<int, int> getAbsChargeRange | ( | ) | const |
get charge range - the actual charge values
get Da error of a logMzPeak from the closest isotope
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
PeakGroup::DecoyFlag getDecoyFlag | ( | ) | const |
get the decoy flag of this
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
double getMonoMass | ( | ) | const |
get monoisotopic mass
float getQScore | ( | ) | const |
get Q score
float getQvalue | ( | PeakGroup::DecoyFlag | flag = PeakGroup::DecoyFlag::target | ) | const |
get calculated qvalue
int getRepAbsCharge | ( | ) | const |
get representative charge
int getScanNumber | ( | ) | const |
get scan number
float getSNR | ( | ) | const |
get total SNR
bool isPositive | ( | ) | const |
get if it is positive mode
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
std::vector<LogMzPeak> recruitAllPeaksInSpectrum | ( | const MSSpectrum & | spec, |
double | tol, | ||
const FLASHDeconvHelperStructs::PrecalculatedAveragine & | avg, | ||
double | mono_mass, | ||
const std::unordered_set< int > & | excluded_integer_mzs_, | ||
int | charge_offset = 0 , |
||
double | charge_multiple = 1.0 , |
||
double | mz_off = .0 |
||
) |
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_integer_mzs_ | mzs that will be included - only for decoy generation |
charge_offset | charge offset from peaks to recruited peaks |
charge_multiple | charge multiplication factor for recruited peaks |
mz_off | mz offset for recruited peaks |
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
|
private |
set per abs_charge signal power
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 setDecoyFlag | ( | PeakGroup::DecoyFlag | index | ) |
for this PeakGroup, specify the decoy flag.
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 setQScore | ( | float | qscore | ) |
set Q score - for FLASHIda log file parsing
void setQvalue | ( | float | q, |
PeakGroup::DecoyFlag | flag | ||
) |
set qvalue.
void setRepAbsCharge | ( | int | max_qscore_charge | ) |
set representative max_qscore_charge
void setScanNumber | ( | int | scan_number | ) |
set scan number
void setSNR | ( | float | snr | ) |
set SNR manually - for FLASHIda log file parsing
void setTargeted | ( | ) |
set if it is targeted
void shrink_to_fit | ( | ) |
|
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.
void updateIsotopeCosineSNRAvgErrorAndQScore | ( | const FLASHDeconvHelperStructs::PrecalculatedAveragine & | avg, |
double | min_cos | ||
) |
Update isotope cosine sore and qscore. Mono mass is also updated one last time. SNR, per charge SNR, and avg errors are updated here.
avg | precalculated averagine |
min_cos | the peak groups with cosine score less than this will have QScore 0. |
void updateMonomassAndIsotopeIntensities | ( | ) |
add monoisotopic indices of peaks by offset and discard negative isotope peaks. Total intensity is also updated
|
private |
using signal and total (signal + noise) power, update SNR value
|
private |
|
private |
|
private |
|
private |
index to specify if this peak_group is a target (0), an isotope decoy (1), a noise (2), or a charge decoy (3)
|
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 decoys
|
private |
|
private |
log Mz peaks
|
private |
|
private |
scoring variables
|
private |
charge range
|
private |
information on the deconvolved mass
|
private |
|
private |
|
private |
|
private |
per charge SNR, isotope cosine, and intensity vectors
|
private |
|
private |
per isotope intensity.
|
private |
|
private |
qvalues with different decoy flags
|
private |
scan number
|
private |