14using uint =
unsigned int;
20#include <boost/dynamic_bitset.hpp>
289 double logMz = -1000;
295 bool is_positive =
true;
297 int isotopeIndex = -1;
346 struct hash<
OpenMS::FLASHHelperClasses::MassFeature>
357 struct hash<
OpenMS::FLASHHelperClasses::LogMzPeak>
Isotope pattern generator for coarse isotope distributions.
Definition CoarseIsotopePatternGenerator.h:81
log transformed peak. After deconvolution, all necessary information from deconvolution such as charg...
Definition FLASHHelperClasses.h:282
bool operator>(const LogMzPeak &a) const
bool operator<(const LogMzPeak &a) const
log mz values are compared
LogMzPeak(const Peak1D &peak, bool positive)
constructor from Peak1D.
LogMzPeak()=default
default constructor
bool operator==(const LogMzPeak &other) const
LogMzPeak(const LogMzPeak &)=default
copy constructor
~LogMzPeak()=default
destructor
double getUnchargedMass() const
Pre-binned averagine isotope-distribution cache used by FLASHDeconv for fast cosine-similarity scorin...
Definition FLASHHelperClasses.h:55
Size getApexIndex(double mass) const
Return the index of the most-abundant isotope inside the trimmed distribution for the bin containing ...
double getSNRMultiplicationFactor(double mass) const
Return the SNR multiplication factor for the bin containing mass.
void setMaxIsotopeIndex(int index)
Set the isotope-index cap consulted by external callers. Does not influence the cached distributions ...
std::vector< double > norms_
Per-bin L2 norm — populated and consumed alongside isotopes_ for fast cosine scoring (vestigial: not ...
Definition FLASHHelperClasses.h:60
std::vector< double > average_mono_mass_difference_
Per-bin difference between the average mass and the monoisotopic mass of the trimmed distribution.
Definition FLASHHelperClasses.h:62
PrecalculatedAveragine()=default
Default-construct an empty cache (no bins populated; the accessors are not safe until the parameteris...
Size max_isotope_index_
Cap on the isotope index used externally by FLASHDeconv. NOT initialised by the constructor — call se...
Definition FLASHHelperClasses.h:75
PrecalculatedAveragine & operator=(const PrecalculatedAveragine &pc)=default
Copy assignment.
size_t getMaxIsotopeIndex() const
Return the externally-set isotope-index cap.
Size getRightCountFromApex(double mass) const
Return the number of significant isotopes to the right of the apex for the bin containing mass.
double min_mass_
Lower bound of the cached mass range (the min_mass passed to the constructor).
Definition FLASHHelperClasses.h:79
double getAverageMassDelta(double mass) const
Return (average_mass - monoisotopic_mass) for the bin's trimmed distribution.
double mass_interval_
Bin step size (the delta passed to the constructor).
Definition FLASHHelperClasses.h:77
Size massToIndex_(double mass) const
Convert mass to a bin index. Clamps to [0, isotopes_.size()-1] for out-of-range inputs (no throw).
double getMostAbundantMassDelta(double mass) const
Return (most_abundant_mass - monoisotopic_mass) for the bin's trimmed distribution.
std::vector< double > abundant_mono_mass_difference_
Per-bin difference between the most-abundant-isotope mass and the monoisotopic mass.
Definition FLASHHelperClasses.h:64
std::vector< double > snr_mul_factor_
Per-bin SNR multiplication factor: (sum-of-normalised-intensities)^2 of the trimmed distribution.
Definition FLASHHelperClasses.h:66
~PrecalculatedAveragine()=default
Destructor.
Size getLastIndex(double mass) const
Return apex_index + right_count_from_apex for the bin containing mass — the index of the rightmost si...
PrecalculatedAveragine(double min_mass, double max_mass, double delta, CoarseIsotopePatternGenerator &generator, bool use_RNA_averagine, double decoy_iso_distance=-1)
Precompute averagine isotope distributions across min_mass .. max_mass in steps of delta.
IsotopeDistribution get(double mass) const
Return the cached trimmed + L2-normalised isotope distribution for the bin containing mass.
PrecalculatedAveragine & operator=(PrecalculatedAveragine &&pc) noexcept=default
Move assignment.
std::vector< IsotopeDistribution > isotopes_
Per-bin isotope distribution. After trimming and L2 normalisation in the constructor.
Definition FLASHHelperClasses.h:58
std::vector< Size > apex_index_
Per-bin index of the most-abundant isotope inside the trimmed distribution.
Definition FLASHHelperClasses.h:72
std::vector< int > left_count_from_apex_
Per-bin count of significant isotopes on the left side of the apex (running maximum across bins; see ...
Definition FLASHHelperClasses.h:68
PrecalculatedAveragine(PrecalculatedAveragine &&other) noexcept=default
Move constructor.
PrecalculatedAveragine(const PrecalculatedAveragine &)=default
Copy constructor.
std::vector< int > right_count_from_apex_
Per-bin count of significant isotopes on the right side of the apex (running maximum across bins; sam...
Definition FLASHHelperClasses.h:70
Size getLeftCountFromApex(double mass) const
Return the number of significant isotopes to the left of the apex for the bin containing mass.
Definition IsotopeDistribution.h:40
A container type that gathers peaks similar in m/z and moving along retention time.
Definition MassTrace.h:36
A 1-dimensional raw data point or peak.
Definition Peak1D.h:30
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition Types.h:97
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
void hash_combine(std::size_t &seed, std::size_t value) noexcept
Combine a hash value with additional data using golden ratio mixing.
Definition HashUtils.h:87
std::size_t hash_float(T value) noexcept
Hash for a floating point type (float or double).
Definition HashUtils.h:142
Isobaric quantities.
Definition FLASHHelperClasses.h:268
int scan
Definition FLASHHelperClasses.h:270
std::vector< double > quantities
Definition FLASHHelperClasses.h:274
bool empty() const
return true if no isobaric quantities have been stored
std::vector< double > merged_quantities
Definition FLASHHelperClasses.h:275
double precursor_mass
Definition FLASHHelperClasses.h:273
double rt
Definition FLASHHelperClasses.h:271
double precursor_mz
Definition FLASHHelperClasses.h:272
Mass feature (Deconvolved masses in spectra are traced by Mass tracing to generate mass features - li...
Definition FLASHHelperClasses.h:230
bool operator<(const MassFeature &a) const
features are compared
Definition FLASHHelperClasses.h:252
double avg_mass
average mass
Definition FLASHHelperClasses.h:244
std::vector< float > per_charge_intensity
per charge and isotope intensities
Definition FLASHHelperClasses.h:237
uint index
feature index;
Definition FLASHHelperClasses.h:233
bool operator>(const MassFeature &a) const
Definition FLASHHelperClasses.h:256
bool is_decoy
Definition FLASHHelperClasses.h:249
int iso_offset
isotope offset between deconvolved masses and mass feature
Definition FLASHHelperClasses.h:240
std::vector< float > per_isotope_intensity
Definition FLASHHelperClasses.h:238
uint ms_level
Definition FLASHHelperClasses.h:250
double rep_mz
Definition FLASHHelperClasses.h:248
MassTrace mt
the trace calculated from the masses
Definition FLASHHelperClasses.h:235
bool operator==(const MassFeature &other) const
Definition FLASHHelperClasses.h:260
int charge_count
Definition FLASHHelperClasses.h:246
double isotope_score
Definition FLASHHelperClasses.h:247
int max_scan_number
Definition FLASHHelperClasses.h:242
Wrapper struct for all the structs needed by the FLASHDeconv The following structures/classes are def...
Definition FLASHHelperClasses.h:41
static double getLogMz(double mz, bool positive)
calculate log mzs from mzs
static float getChargeMass(bool positive_ioniziation_mode)
get charge carrier mass : positive mode mass of (Constants::PROTON_MASS_U) and negative mode mass of ...
std::size_t operator()(const OpenMS::FLASHHelperClasses::LogMzPeak &peak) const noexcept
Definition FLASHHelperClasses.h:359
std::size_t operator()(const OpenMS::FLASHHelperClasses::MassFeature &mf) const noexcept
Definition FLASHHelperClasses.h:348