OpenMS
SiriusMzTabWriter.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Oliver Alka $
6 // $Authors: Oliver Alka $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
12 #include <OpenMS/FORMAT/CsvFile.h>
13 
14 namespace OpenMS
15 {
16  class OPENMS_DLLAPI SiriusMzTabWriter
17  {
18  public:
19 
51  {
52  public:
56  int rank = 0;
57  double iso_score = 0.0;
58  double tree_score = 0.0;
59  double sirius_score = 0.0;
60  int explainedpeaks = 0;
61  double explainedintensity = 0.0;
62  double median_mass_error_fragment_peaks_ppm = 0.0;
63  double median_absolute_mass_error_fragment_peaks_ppm = 0.0;
64  double mass_error_precursor_ppm = 0.0;
65  };
66 
68  {
69  public:
70  double mz = 0.;
71  double rt = 0.;
73  int scan_index = -1;
74  int scan_number = -1;
76  std::vector<SiriusAdapterHit> hits;
77  };
78 
80  {
81  public:
82  std::vector<SiriusAdapterIdentification> identifications;
83  };
84 
86  {
87  public:
88  StringList ext_n_id; // multiple possible MS2 spectra
89  double ext_mz = 0.0;
90  double ext_rt = 0.0;
91  };
92 
96  static int extractScanIndex(const String& path);
97 
101  static int extractScanNumber(const String& path);
102 
106  static String extractFeatureId(const String& path);
107 
111  static std::map< std::string, Size > extract_columnname_to_columnindex(CsvFile& csvfile);
112 
116  static SiriusSpectrumMSInfo extractSpectrumMSInfo(const String& single_sirius_path);
117 
128  static void read(const std::vector<String>& sirius_output_paths,
129  const String& original_input_mzml,
130  const Size& top_n_hits,
131  MzTab& result);
132 
133  };
134 
135  namespace SiriusVersion
136  {
138  inline const std::string CURRENT_VERSION = "5.6.3";
139  }
140 
141 }
142 
This class handles csv files. Currently only loading is implemented. Does NOT support comment lines!
Definition: CsvFile.h:25
Data model of MzTab files. Please see the official MzTab specification at https://code....
Definition: MzTab.h:452
Definition: SiriusMzTabWriter.h:17
std::vector< SiriusAdapterHit > hits
Definition: SiriusMzTabWriter.h:76
static SiriusSpectrumMSInfo extractSpectrumMSInfo(const String &single_sirius_path)
Extract mz, rt of the precursor and the nativeID of the corresponding MS2 spectra in the spectrum....
OpenMS::String feature_id
Definition: SiriusMzTabWriter.h:75
static std::map< std::string, Size > extract_columnname_to_columnindex(CsvFile &csvfile)
Extract columnname and index based in SIRIUS entries.
OpenMS::String adduct
Definition: SiriusMzTabWriter.h:54
static String extractFeatureId(const String &path)
Extract feature_id from filepath.
static int extractScanNumber(const String &path)
Extract scan_number from filepath.
OpenMS::String precursor_formula
Definition: SiriusMzTabWriter.h:55
static void read(const std::vector< String > &sirius_output_paths, const String &original_input_mzml, const Size &top_n_hits, MzTab &result)
Conversion of sirius output to mzTab.
OpenMS::String formula
Definition: SiriusMzTabWriter.h:53
static int extractScanIndex(const String &path)
Extract scan_index from filepath.
StringList ext_n_id
Definition: SiriusMzTabWriter.h:88
OpenMS::StringList native_ids
Definition: SiriusMzTabWriter.h:72
std::vector< SiriusAdapterIdentification > identifications
Definition: SiriusMzTabWriter.h:82
Internal structure used in SiriusAdapter that is used for the conversion of the sirius output to an m...
Definition: SiriusMzTabWriter.h:51
Definition: SiriusMzTabWriter.h:80
Definition: SiriusMzTabWriter.h:86
A more convenient string class.
Definition: String.h:34
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:101
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:44
const std::string CURRENT_VERSION
SIRIUS version.
Definition: SiriusMzTabWriter.h:138
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22