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>

Collaboration diagram for ThermoRawFileMetadata:
[legend]

Classes

Public Member Functions

nlohmann::json precursors (const nlohmann::json &scan)
 Precursor descriptors of one scan; scans must be passed in acquisition order.
 

Static Public Member Functions

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

Private Member Functions

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

Static Private Member Functions

static bool supplemental_ (const nlohmann::json &first, const nlohmann::json &second)
 
static std::size_t lastReaction_ (const nlohmann::json &reactions)
 
static std::vector< double > spsMasses_ (const nlohmann::json &scan)
 

Private Attributes

std::map< int, State > scans_
 
std::map< std::string, int > filters_
 

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
Collaboration diagram for ThermoRawFileMetadata::State:
[legend]
Class Members
int level = 1
string native_id
json own = nlohmann::json::array() 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 nlohmann::json &  reactions)
inlinestaticprivate

◆ number()

static nlohmann::json number ( const std::string &  value)
inlinestatic

Parse a trailer value as a number.

Returns
the number, or JSON null 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".

Referenced by ThermoRawFileMetadata::precursors(), and ThermoRawFileMetadata::spsMasses_().

◆ parentFromFilter_()

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

◆ precursors()

nlohmann::json precursors ( const nlohmann::json &  scan)
inline

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

MS1 scans return an empty array and are only recorded as potential parents. For MSn scans the array 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.

References ThermoRawFileMetadata::filters_, ThermoRawFileMetadata::lastReaction_(), ThermoRawFileMetadata::State::level, ThermoRawFileMetadata::State::native_id, ThermoRawFileMetadata::number(), ThermoRawFileMetadata::State::own, ThermoRawFileMetadata::State::parent, ThermoRawFileMetadata::parentFromFilter_(), ThermoRawFileMetadata::State::reactions, ThermoRawFileMetadata::scans_, ThermoRawFileMetadata::selectedIon(), ThermoRawFileMetadata::spsMasses_(), and ThermoRawFileMetadata::trailer().

◆ selectedIon()

static double selectedIon ( double  target,
const nlohmann::json &  mono,
double  width 
)
inlinestatic

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

Referenced by ThermoRawFileMetadata::precursors().

◆ spsMasses_()

static std::vector< double > spsMasses_ ( const nlohmann::json &  scan)
inlinestaticprivate

◆ supplemental_()

static bool supplemental_ ( const nlohmann::json &  first,
const nlohmann::json &  second 
)
inlinestaticprivate

References first.

Referenced by ThermoRawFileMetadata::lastReaction_().

◆ trailer()

static std::string trailer ( const nlohmann::json &  scan,
const std::string &  label 
)
inlinestatic

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

Referenced by ThermoRawFileMetadata::precursors(), and ThermoRawFileMetadata::spsMasses_().

Member Data Documentation

◆ filters_

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

◆ scans_

std::map<int, State> scans_
private