OpenMS
Loading...
Searching...
No Matches
NuXLSpectrumIndex Struct Reference

Search-time lookup structures for the OpenNuXL database search. More...

#include <OpenNuXL/include/NuXLSearchIndex.h>

Public Member Functions

void build (const MSSpectrum &s)
 
size_t lowerBound (double x) const
 same result as std::lower_bound on the peak m/z
 
size_t nearest (double x) const
 same result as MSSpectrum::findNearest(x)
 

Public Attributes

const MSSpectrum * spec = nullptr
 
std::vector< double > mz
 peak m/z (copy, contiguous)
 
std::vector< float > intensity
 peak intensities (copy, contiguous)
 
std::vector< int > charge
 peak charges (IntegerDataArray NuXLConstants::IA_CHARGE_INDEX)
 
std::vector< uint16_t > lb
 lb[k] = index of the first peak with m/z >= k * BIN
 
float marker_ions_sub_score = 0
 MorpheusScore of the spectrum against all marker ions (independent of the candidate)
 
std::vector< uint8_t > has_tag_for_fa_id
 fragment adduct name (by registry id) is listed in StringDataArray 0 (nucleotide tags)
 

Static Public Attributes

static constexpr double BIN = 2.0
 
static constexpr double INV_BIN = 1.0 / BIN
 

Detailed Description

Search-time lookup structures for the OpenNuXL database search.

Everything in here only changes how values are looked up, never what is computed: the lookups return the same results as MSSpectrum::findNearest or std::lower_bound / std::upper_bound on the full containers. Per-spectrum data that is computed once after preprocessing and reused for every candidate peptide.

Member Function Documentation

◆ build()

◆ lowerBound()

size_t lowerBound ( double  x) const
inline

same result as std::lower_bound on the peak m/z

References NuXLSpectrumIndex::INV_BIN, NuXLSpectrumIndex::lb, and NuXLSpectrumIndex::mz.

Referenced by NuXLSpectrumIndex::nearest().

◆ nearest()

size_t nearest ( double  x) const
inline

same result as MSSpectrum::findNearest(x)

References NuXLSpectrumIndex::lowerBound(), and NuXLSpectrumIndex::mz.

Member Data Documentation

◆ BIN

constexpr double BIN = 2.0
staticconstexpr

◆ charge

std::vector<int> charge

peak charges (IntegerDataArray NuXLConstants::IA_CHARGE_INDEX)

Referenced by NuXLSpectrumIndex::build().

◆ has_tag_for_fa_id

std::vector<uint8_t> has_tag_for_fa_id

fragment adduct name (by registry id) is listed in StringDataArray 0 (nucleotide tags)

Referenced by NuXLFragmentAdductRegistry::annotateSpectrum().

◆ intensity

std::vector<float> intensity

peak intensities (copy, contiguous)

Referenced by NuXLSpectrumIndex::build().

◆ INV_BIN

constexpr double INV_BIN = 1.0 / BIN
staticconstexpr

◆ lb

std::vector<uint16_t> lb

lb[k] = index of the first peak with m/z >= k * BIN

Referenced by NuXLSpectrumIndex::build(), and NuXLSpectrumIndex::lowerBound().

◆ marker_ions_sub_score

float marker_ions_sub_score = 0

MorpheusScore of the spectrum against all marker ions (independent of the candidate)

◆ mz

std::vector<double> mz

◆ spec