OpenMS
Loading...
Searching...
No Matches
SpectralMatch Class Reference

One library-search match record: the observed spectrum, the matching DB spectrum, the score, and the metabolite metadata copied from the hit. More...

#include <OpenMS/ANALYSIS/ID/MetaboliteSpectralMatching.h>

Collaboration diagram for SpectralMatch:
[legend]

Public Member Functions

 SpectralMatch ()
 Default constructor (zero-initialised numeric fields, empty strings)
 
 ~SpectralMatch ()
 Default destructor.
 
 SpectralMatch (const SpectralMatch &)
 Copy constructor.
 
SpectralMatchoperator= (const SpectralMatch &)
 Assignment operator.
 
double getObservedPrecursorMass () const
 Precursor mass (Da) of the experimental MS2 spectrum being matched.
 
void setObservedPrecursorMass (const double &)
 Setter for the observed-side precursor mass (Da)
 
double getObservedPrecursorRT () const
 Retention time (seconds) at which the observed MS2 spectrum was acquired.
 
void setObservedPrecursorRT (const double &)
 Setter for the observed-side precursor RT (seconds)
 
double getFoundPrecursorMass () const
 Precursor mass (Da) recorded on the DB-side spectrum that matched.
 
void setFoundPrecursorMass (const double &)
 Setter for the DB-side precursor mass (Da)
 
Int getFoundPrecursorCharge () const
 Precursor charge recorded on the DB-side spectrum.
 
void setFoundPrecursorCharge (const Int &)
 Setter for the DB-side precursor charge.
 
double getMatchingScore () const
 Hyperscore (higher is better; 0 if fewer than three peaks matched — see MetaboliteSpectralMatching::computeHyperScore)
 
void setMatchingScore (const double &)
 Setter for the hyperscore.
 
Size getObservedSpectrumIndex () const
 Index of the observed MS2 spectrum in the input PeakMap passed to MetaboliteSpectralMatching::run.
 
void setObservedSpectrumIndex (const Size &)
 Setter for the observed-spectrum index.
 
Size getMatchingSpectrumIndex () const
 Index of the matching DB spectrum in the spectral-library PeakMap.
 
void setMatchingSpectrumIndex (const Size &)
 Setter for the DB-spectrum index.
 
std::string getObservedSpectrumNativeID () const
 Native id (vendor-specific id) of the observed MS2 spectrum.
 
void setObservedSpectrumNativeID (const std::string &)
 Setter for the observed-spectrum native id.
 
std::string getPrimaryIdentifier () const
 Primary identifier of the matched metabolite. The .cpp populates this via the first available of: GNPS_Spectrum_ID, Massbank_Accession_ID, the metabolite-name meta value, or — as a last fallback — the DB spectrum's native id.
 
void setPrimaryIdentifier (const std::string &)
 Setter for the primary metabolite identifier.
 
std::string getSecondaryIdentifier () const
 Secondary identifier of the matched metabolite. The .cpp populates this from the HMDB_ID meta value on the DB-side spectrum.
 
void setSecondaryIdentifier (const std::string &)
 Setter for the secondary metabolite identifier.
 
std::string getCommonName () const
 Common (trivial) name of the matched metabolite.
 
void setCommonName (const std::string &)
 Setter for the common name.
 
std::string getSumFormula () const
 Chemical sum formula of the matched metabolite (neutral)
 
void setSumFormula (const std::string &)
 Setter for the sum formula.
 
std::string getInchiString () const
 InChI string of the matched metabolite.
 
void setInchiString (const std::string &)
 Setter for the InChI string.
 
std::string getSMILESString () const
 SMILES string of the matched metabolite.
 
void setSMILESString (const std::string &)
 Setter for the SMILES string.
 
std::string getPrecursorAdduct () const
 Adduct annotation recorded on the DB-side precursor (e.g. "[M+H]+")
 
void setPrecursorAdduct (const std::string &)
 Setter for the precursor adduct.
 
double getObservedCCS () const
 Observed collision cross section (CCS) of the experimental precursor in Angstrom^2; -1.0 if not available.
 
void setObservedCCS (const double &)
 Setter for the observed CCS (Angstrom^2); use -1.0 to indicate "not available".
 
double getFoundCCS () const
 CCS (Angstrom^2) of the matching DB-side spectrum; -1.0 if not available.
 
void setFoundCCS (const double &)
 Setter for the DB-side CCS (Angstrom^2); use -1.0 to indicate "not available".
 

Private Attributes

double observed_precursor_mass_
 Observed-side precursor mass (Da)
 
double observed_precursor_rt_
 Observed-side precursor RT (seconds)
 
double found_precursor_mass_
 DB-side precursor mass (Da)
 
Int found_precursor_charge_
 DB-side precursor charge.
 
double matching_score_
 Hyperscore (see MetaboliteSpectralMatching::computeHyperScore)
 
Size observed_spectrum_idx_
 Index of the observed spectrum in the input PeakMap.
 
Size matching_spectrum_idx_
 Index of the DB spectrum in the spectral-library PeakMap.
 
std::string observed_spectrum_native_id_
 Native id (vendor-specific) of the observed spectrum.
 
std::string primary_id_
 Primary metabolite identifier.
 
std::string secondary_id_
 Secondary metabolite identifier.
 
std::string common_name_
 Trivial / common name.
 
std::string sum_formula_
 Neutral chemical sum formula.
 
std::string inchi_string_
 InChI string.
 
std::string smiles_string_
 SMILES string.
 
std::string precursor_adduct_
 DB-side precursor adduct annotation.
 
double observed_ccs_
 Observed-side collision cross section (Angstrom^2); -1.0 if not available.
 
double found_ccs_
 DB-side collision cross section (Angstrom^2); -1.0 if not available.
 

Detailed Description

One library-search match record: the observed spectrum, the matching DB spectrum, the score, and the metabolite metadata copied from the hit.

Used by MetaboliteSpectralMatching to accumulate all candidate matches before the top-N export step. The fields fall into three groups:

  • Observed-side: the index / native id of the experimental MS2 spectrum and its precursor mass / RT.
  • DB-side: the index of the matching DB spectrum, the DB precursor mass / charge, and the hyperscore (see MetaboliteSpectralMatching::computeHyperScore).
  • Metabolite metadata copied from the DB spectrum: primary/secondary identifier, common name, sum formula, InChI, SMILES, and the precursor adduct.

Constructor & Destructor Documentation

◆ SpectralMatch() [1/2]

Default constructor (zero-initialised numeric fields, empty strings)

◆ ~SpectralMatch()

Default destructor.

◆ SpectralMatch() [2/2]

Copy constructor.

Member Function Documentation

◆ getCommonName()

std::string getCommonName ( ) const

Common (trivial) name of the matched metabolite.

◆ getFoundCCS()

double getFoundCCS ( ) const

CCS (Angstrom^2) of the matching DB-side spectrum; -1.0 if not available.

◆ getFoundPrecursorCharge()

Int getFoundPrecursorCharge ( ) const

Precursor charge recorded on the DB-side spectrum.

◆ getFoundPrecursorMass()

double getFoundPrecursorMass ( ) const

Precursor mass (Da) recorded on the DB-side spectrum that matched.

◆ getInchiString()

std::string getInchiString ( ) const

InChI string of the matched metabolite.

◆ getMatchingScore()

double getMatchingScore ( ) const

Hyperscore (higher is better; 0 if fewer than three peaks matched — see MetaboliteSpectralMatching::computeHyperScore)

Referenced by SpectralMatchScoreComparator::operator()().

◆ getMatchingSpectrumIndex()

Size getMatchingSpectrumIndex ( ) const

Index of the matching DB spectrum in the spectral-library PeakMap.

◆ getObservedCCS()

double getObservedCCS ( ) const

Observed collision cross section (CCS) of the experimental precursor in Angstrom^2; -1.0 if not available.

◆ getObservedPrecursorMass()

double getObservedPrecursorMass ( ) const

Precursor mass (Da) of the experimental MS2 spectrum being matched.

◆ getObservedPrecursorRT()

double getObservedPrecursorRT ( ) const

Retention time (seconds) at which the observed MS2 spectrum was acquired.

◆ getObservedSpectrumIndex()

Size getObservedSpectrumIndex ( ) const

Index of the observed MS2 spectrum in the input PeakMap passed to MetaboliteSpectralMatching::run.

◆ getObservedSpectrumNativeID()

std::string getObservedSpectrumNativeID ( ) const

Native id (vendor-specific id) of the observed MS2 spectrum.

◆ getPrecursorAdduct()

std::string getPrecursorAdduct ( ) const

Adduct annotation recorded on the DB-side precursor (e.g. "[M+H]+")

◆ getPrimaryIdentifier()

std::string getPrimaryIdentifier ( ) const

Primary identifier of the matched metabolite. The .cpp populates this via the first available of: GNPS_Spectrum_ID, Massbank_Accession_ID, the metabolite-name meta value, or — as a last fallback — the DB spectrum's native id.

◆ getSecondaryIdentifier()

std::string getSecondaryIdentifier ( ) const

Secondary identifier of the matched metabolite. The .cpp populates this from the HMDB_ID meta value on the DB-side spectrum.

◆ getSMILESString()

std::string getSMILESString ( ) const

SMILES string of the matched metabolite.

◆ getSumFormula()

std::string getSumFormula ( ) const

Chemical sum formula of the matched metabolite (neutral)

◆ operator=()

SpectralMatch & operator= ( const SpectralMatch )

Assignment operator.

◆ setCommonName()

void setCommonName ( const std::string &  )

Setter for the common name.

◆ setFoundCCS()

void setFoundCCS ( const double &  )

Setter for the DB-side CCS (Angstrom^2); use -1.0 to indicate "not available".

◆ setFoundPrecursorCharge()

void setFoundPrecursorCharge ( const Int )

Setter for the DB-side precursor charge.

◆ setFoundPrecursorMass()

void setFoundPrecursorMass ( const double &  )

Setter for the DB-side precursor mass (Da)

◆ setInchiString()

void setInchiString ( const std::string &  )

Setter for the InChI string.

◆ setMatchingScore()

void setMatchingScore ( const double &  )

Setter for the hyperscore.

◆ setMatchingSpectrumIndex()

void setMatchingSpectrumIndex ( const Size )

Setter for the DB-spectrum index.

◆ setObservedCCS()

void setObservedCCS ( const double &  )

Setter for the observed CCS (Angstrom^2); use -1.0 to indicate "not available".

◆ setObservedPrecursorMass()

void setObservedPrecursorMass ( const double &  )

Setter for the observed-side precursor mass (Da)

◆ setObservedPrecursorRT()

void setObservedPrecursorRT ( const double &  )

Setter for the observed-side precursor RT (seconds)

◆ setObservedSpectrumIndex()

void setObservedSpectrumIndex ( const Size )

Setter for the observed-spectrum index.

◆ setObservedSpectrumNativeID()

void setObservedSpectrumNativeID ( const std::string &  )

Setter for the observed-spectrum native id.

◆ setPrecursorAdduct()

void setPrecursorAdduct ( const std::string &  )

Setter for the precursor adduct.

◆ setPrimaryIdentifier()

void setPrimaryIdentifier ( const std::string &  )

Setter for the primary metabolite identifier.

◆ setSecondaryIdentifier()

void setSecondaryIdentifier ( const std::string &  )

Setter for the secondary metabolite identifier.

◆ setSMILESString()

void setSMILESString ( const std::string &  )

Setter for the SMILES string.

◆ setSumFormula()

void setSumFormula ( const std::string &  )

Setter for the sum formula.

Member Data Documentation

◆ common_name_

std::string common_name_
private

Trivial / common name.

◆ found_ccs_

double found_ccs_
private

DB-side collision cross section (Angstrom^2); -1.0 if not available.

◆ found_precursor_charge_

Int found_precursor_charge_
private

DB-side precursor charge.

◆ found_precursor_mass_

double found_precursor_mass_
private

DB-side precursor mass (Da)

◆ inchi_string_

std::string inchi_string_
private

InChI string.

◆ matching_score_

double matching_score_
private

◆ matching_spectrum_idx_

Size matching_spectrum_idx_
private

Index of the DB spectrum in the spectral-library PeakMap.

◆ observed_ccs_

double observed_ccs_
private

Observed-side collision cross section (Angstrom^2); -1.0 if not available.

◆ observed_precursor_mass_

double observed_precursor_mass_
private

Observed-side precursor mass (Da)

◆ observed_precursor_rt_

double observed_precursor_rt_
private

Observed-side precursor RT (seconds)

◆ observed_spectrum_idx_

Size observed_spectrum_idx_
private

Index of the observed spectrum in the input PeakMap.

◆ observed_spectrum_native_id_

std::string observed_spectrum_native_id_
private

Native id (vendor-specific) of the observed spectrum.

◆ precursor_adduct_

std::string precursor_adduct_
private

DB-side precursor adduct annotation.

◆ primary_id_

std::string primary_id_
private

Primary metabolite identifier.

◆ secondary_id_

std::string secondary_id_
private

Secondary metabolite identifier.

◆ smiles_string_

std::string smiles_string_
private

SMILES string.

◆ sum_formula_

std::string sum_formula_
private

Neutral chemical sum formula.