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

Resolve the precursor hierarchy from bridge metadata without fetching peaks. Keeps isolation targets distinct from selected ions, and retains SPS selections and supplemental reactions. The filter fallback follows ThermoRawFileParser. More...

#include <OpenMS/FORMAT/HANDLERS/ThermoRawFileMetadata.h>

Classes

Public Member Functions

std::vector< ThermoPrecursor > precursors (const ThermoScan &scan)
 Precursor descriptors of one scan; scans must be passed in acquisition order.
 

Static Public Member Functions

static std::string trailer (const ThermoScan &scan, const std::string &label)
 Value of the trailer-extra entry with exactly this label, or "" if absent.
 
static std::optional< double > number (const std::string &value)
 Parse a trailer value as a number.
 
static double selectedIon (double target, std::optional< double > mono, double width)
 Selected ion m/z of a precursor (ThermoRawFileParser rule).
 

Private Member Functions

int parentFromFilter_ (const std::string &key) const
 Most recent scan whose filter key is the parent of key (0 if none).
 

Static Private Member Functions

static bool supplemental_ (const ThermoReaction &first, const ThermoReaction &second)
 True if second is the supplemental (HCD / CID) step of an ETD / ECD reaction first on the same target.
 
static std::size_t lastReaction_ (const std::vector< ThermoReaction > &reactions)
 Index of the reaction that isolated this scan's precursor when no parent is known.
 
static std::vector< double > spsMasses_ (const ThermoScan &scan)
 SPS target masses from the legacy ("SPS Mass N:") or modern ("SPS Masses:") trailer labels.
 

Private Attributes

std::map< int, State > scans_
 seen scans by scan number
 
std::map< std::string, int > filters_
 most recent scan per filter key ("" for MS1)
 

Detailed Description

Resolve the precursor hierarchy from bridge metadata without fetching peaks. Keeps isolation targets distinct from selected ions, and retains SPS selections and supplemental reactions. The filter fallback follows ThermoRawFileParser.


Class Documentation

◆ OpenMS::Internal::ThermoRawFileMetadata::State

struct OpenMS::Internal::ThermoRawFileMetadata::State

What is retained per seen scan to resolve later scans' parents.

Class Members
int level = 1 MS order.
string native_id spectrum reference for descendants
vector< ThermoPrecursor > own this scan's own precursor descriptors
int parent = 0 scan this one descends from (0 if unknown)
size_t reactions = 0 reactions consumed up to and including this scan

Member Function Documentation

◆ lastReaction_()

static std::size_t lastReaction_ ( const std::vector< ThermoReaction > &  reactions)
staticprivate

Index of the reaction that isolated this scan's precursor when no parent is known.

◆ number()

static std::optional< double > number ( const std::string &  value)
static

Parse a trailer value as a number.

Returns
the number, or an empty optional when the value is empty, not fully numeric (e.g. "2,5" or "12.3abc") or not finite. A literal zero is a valid number, not "missing".

◆ parentFromFilter_()

int parentFromFilter_ ( const std::string &  key) const
private

Most recent scan whose filter key is the parent of key (0 if none).

◆ precursors()

std::vector< ThermoPrecursor > precursors ( const ThermoScan &  scan)

Precursor descriptors of one scan; scans must be passed in acquisition order.

MS1 scans return an empty vector and are only recorded as potential parents. For MSn scans the vector holds the scan's own precursor (isolation target, selected ion, charge, window, parent scan / spectrum reference, activation and supplemental activation), followed by further SPS selections and then the precursors of every ancestor scan, so an MS3 scan lists its MS2 parent's precursor as well. Only each scan's own precursors are retained internally; ancestors are resolved through parent links on request.

◆ selectedIon()

static double selectedIon ( double  target,
std::optional< double >  mono,
double  width 
)
static

Selected ion m/z of a precursor (ThermoRawFileParser rule).

Parameters
targetisolation window target m/z of the reaction
mono"Monoisotopic M/Z:" trailer value as returned by number()
widthisolation width (0 if unknown)
Returns
the monoisotopic m/z when it is set and plausibly inside the isolation window (narrow windows accept -3.0 / +2.5 Th around the target), otherwise the target

◆ spsMasses_()

static std::vector< double > spsMasses_ ( const ThermoScan &  scan)
staticprivate

SPS target masses from the legacy ("SPS Mass N:") or modern ("SPS Masses:") trailer labels.

◆ supplemental_()

static bool supplemental_ ( const ThermoReaction &  first,
const ThermoReaction &  second 
)
staticprivate

True if second is the supplemental (HCD / CID) step of an ETD / ECD reaction first on the same target.

◆ trailer()

static std::string trailer ( const ThermoScan &  scan,
const std::string &  label 
)
static

Value of the trailer-extra entry with exactly this label, or "" if absent.

Member Data Documentation

◆ filters_

std::map<std::string, int> filters_
private

most recent scan per filter key ("" for MS1)

◆ scans_

std::map<int, State> scans_
private

seen scans by scan number