![]() |
OpenMS
|
Algorithm class behind the SiriusExport tool: writes a SIRIUS .ms input file from MS data and (optionally) a featureXML.
More...
#include <OpenMS/ANALYSIS/ID/SiriusExportAlgorithm.h>
Public Member Functions | |
| SiriusExportAlgorithm () | |
| Default constructor; installs the export parameters (see class docs) | |
| bool | isFeatureOnly () const |
true if only feature-mapped MS2 spectra should be written (parameter feature_only) | |
| UInt | getFilterByNumMassTraces () const |
Minimum number of mass traces a feature must have to be retained (parameter filter_by_num_masstraces) | |
| double | getPrecursorMzTolerance () const |
| Half-width of the precursor m/z window used during MS2-to-feature mapping (unit per precursorMzToleranceUnitIsPPM) | |
| double | getPrecursorRtTolerance () const |
| Half-width of the precursor RT window (seconds) used during MS2-to-feature mapping. | |
| bool | precursorMzToleranceUnitIsPPM () const |
true if getPrecursorMzTolerance is interpreted as ppm; otherwise as Th | |
| bool | isNoMasstraceInfoIsotopePattern () const |
true to suppress mass-trace-derived isotope-pattern hints in the .ms output (parameter no_masstrace_info_isotope_pattern) | |
| int | getIsotopePatternIterations () const |
Number of SIRIUS isotope-pattern iterations to record in the .ms output (parameter isotope_pattern_iterations) | |
| void | preprocessing (const std::string &featureinfo, const MSExperiment &spectra, FeatureMapping::FeatureMappingInfo &feature_mapping_info, FeatureMapping::FeatureToMs2Indices &feature_ms2_indices) const |
| Build the feature/MS2 mapping consumed by run() from a featureXML. | |
| void | logFeatureSpectraNumber (const std::string &featureinfo, const FeatureMapping::FeatureToMs2Indices &feature_ms2_indices, const MSExperiment &spectra) const |
Emit OPENMS_LOG_INFO messages summarising how many features / MS2 spectra will be processed. | |
| void | run (const StringList &mzML_files, const StringList &featureXML_files, const std::string &out_ms, const std::string &out_compoundinfo) const |
Export the SIRIUS .ms input file (and optional compound-info TSV). | |
Public Member Functions inherited from DefaultParamHandler | |
| DefaultParamHandler (const std::string &name) | |
| Constructor with name that is displayed in error messages. | |
| DefaultParamHandler (const DefaultParamHandler &rhs) | |
| Copy constructor. | |
| virtual | ~DefaultParamHandler () |
| Destructor. | |
| DefaultParamHandler & | operator= (const DefaultParamHandler &rhs) |
| Assignment operator. | |
| virtual bool | operator== (const DefaultParamHandler &rhs) const |
| Equality operator. | |
| void | setParameters (const Param ¶m) |
| Sets the parameters. | |
| const Param & | getParameters () const |
| Non-mutable access to the parameters. | |
| const Param & | getDefaults () const |
| Non-mutable access to the default parameters. | |
| const std::string & | getName () const |
| Non-mutable access to the name. | |
| void | setName (const std::string &name) |
| Mutable access to the name. | |
| const std::vector< std::string > & | getSubsections () const |
| Non-mutable access to the registered subsections. | |
Additional Inherited Members | |
Static Public Member Functions inherited from DefaultParamHandler | |
| static void | writeParametersToMetaValues (const Param &write_this, MetaInfoInterface &write_here, const std::string &key_prefix="") |
| Writes all parameters to meta values. | |
Protected Member Functions inherited from DefaultParamHandler | |
| virtual void | updateMembers_ () |
| This method is used to update extra member variables at the end of the setParameters() method. | |
| void | defaultsToParam_ () |
| Updates the parameters after the defaults have been set in the constructor. | |
Protected Attributes inherited from DefaultParamHandler | |
| Param | param_ |
| Container for current parameters. | |
| Param | defaults_ |
| Container for default parameters. This member should be filled in the constructor of derived classes! | |
| std::vector< std::string > | subsections_ |
| Container for registered subsections. This member should be filled in the constructor of derived classes! | |
| std::string | error_name_ |
| Name that is displayed in error messages during the parameter checking. | |
| bool | check_defaults_ |
| If this member is set to false no checking if parameters in done;. | |
| bool | warn_empty_defaults_ |
| If this member is set to false no warning is emitted when defaults are empty;. | |
Algorithm class behind the SiriusExport tool: writes a SIRIUS .ms input file from MS data and (optionally) a featureXML.
Drives the export pipeline that feeds SIRIUS / CSI:FingerID / AssayGeneratorMetabo:
.ms file and the optional compound-info TSV.Configurable behaviour is exposed through DefaultParamHandler defaults (see the constructor). The accessors below resolve those parameters by name for callers that prefer typed getters over Param lookups.
Default constructor; installs the export parameters (see class docs)
|
inline |
Minimum number of mass traces a feature must have to be retained (parameter filter_by_num_masstraces)
|
inline |
Number of SIRIUS isotope-pattern iterations to record in the .ms output (parameter isotope_pattern_iterations)
|
inline |
Half-width of the precursor m/z window used during MS2-to-feature mapping (unit per precursorMzToleranceUnitIsPPM)
|
inline |
Half-width of the precursor RT window (seconds) used during MS2-to-feature mapping.
|
inline |
true if only feature-mapped MS2 spectra should be written (parameter feature_only)
|
inline |
true to suppress mass-trace-derived isotope-pattern hints in the .ms output (parameter no_masstrace_info_isotope_pattern)
| void logFeatureSpectraNumber | ( | const std::string & | featureinfo, |
| const FeatureMapping::FeatureToMs2Indices & | feature_ms2_indices, | ||
| const MSExperiment & | spectra | ||
| ) | const |
Emit OPENMS_LOG_INFO messages summarising how many features / MS2 spectra will be processed.
Three modes depending on whether a featureXML is in play:
isFeatureOnly() and featureinfo non-empty: logs assigned-feature count only.featureinfo non-empty (but not feature-only): logs both assigned-feature count and the number of additional unassigned MS2 spectra.featureinfo empty: logs the raw MS2 spectrum count in spectra.| [in] | featureinfo | Path to featureXML (controls which log branch is taken). |
| [in] | feature_ms2_indices | Output of preprocessing — feature/MS2 mapping. |
| [in] | spectra | Spectra container used when no featureXML is given. |
|
inline |
true if getPrecursorMzTolerance is interpreted as ppm; otherwise as Th
| void preprocessing | ( | const std::string & | featureinfo, |
| const MSExperiment & | spectra, | ||
| FeatureMapping::FeatureMappingInfo & | feature_mapping_info, | ||
| FeatureMapping::FeatureToMs2Indices & | feature_ms2_indices | ||
| ) | const |
Build the feature/MS2 mapping consumed by run() from a featureXML.
If featureinfo is empty the call is a no-op (both output arguments stay untouched) — in that case run() will treat every MS2 spectrum as unassigned.
If featureinfo is given but isFeatureOnly() is false, the mass-trace filter is silently clamped to 1 (with a warning) so that the adduct annotation on multi-trace features is preserved for MS2 spectra. Features with fewer than getFilterByNumMassTraces() mass traces are then dropped, the survivors are wrapped in a KDTreeFeatureMaps, and MS2 spectra are matched to features via FeatureMapping::assignMS2IndexToFeature using the configured precursor tolerances.
| [in] | featureinfo | Path to featureXML; if empty, the function is a no-op. |
| [in] | spectra | Spectra container (MS1 + MS2); only MS2 are mapped. |
| [out] | feature_mapping_info | Receives the loaded feature maps and the kd-tree built from them. |
| [out] | feature_ms2_indices | Receives the MS2-to-feature assignment / unassigned-MS2 list. |
| Exception::FileEmpty | If featureinfo is non-empty but the file does not exist or is empty. |
| void run | ( | const StringList & | mzML_files, |
| const StringList & | featureXML_files, | ||
| const std::string & | out_ms, | ||
| const std::string & | out_compoundinfo | ||
| ) | const |
Export the SIRIUS .ms input file (and optional compound-info TSV).
Iterates over mzML_files (and, if non-empty, the same-index entry of featureXML_files for feature-level annotation), runs preprocessing internally, and writes one SIRIUS .ms file at out_ms. If out_compoundinfo is non-empty, also writes a per-compound TSV with provenance/metadata.
| [in] | mzML_files | Input mzML paths to export. |
| [in] | featureXML_files | Optional per-mzML featureXML paths (parallel to mzML_files, or empty). |
| [in] | out_ms | Destination SIRIUS .ms file (overwritten). |
| [in] | out_compoundinfo | Destination compound-info TSV (overwritten); skipped if empty. |
| Exception::UnableToCreateFile | If out_ms cannot be opened for writing. |