OpenMS
MzTabM.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, OpenMS Inc. -- 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 
15 #include <set>
16 
17 namespace OpenMS
18 {
27  {
29  {
30  return lhs->identified_molecule_var.getIdentifiedCompoundRef()->identifier < rhs->identified_molecule_var.getIdentifiedCompoundRef()->identifier;
31  }
32  };
33 
37  class OPENMS_DLLAPI MzTabMAssayMetaData
38  {
39  public:
41  std::map<Size,MzTabParameter> custom;
45  };
46 
50  class OPENMS_DLLAPI MzTabMMSRunMetaData
51  {
52  public:
57  std::map<Size, MzTabParameter> fragmentation_method;
58  std::map<Size, MzTabParameter> scan_polarity;
61  };
62 
66  class OPENMS_DLLAPI MzTabMStudyVariableMetaData
67  {
68  public:
70  std::vector<int> assay_refs;
75  };
76 
80  class OPENMS_DLLAPI MzTabMDatabaseMetaData // mztab-m
81  {
82  public:
87  };
88 
92  class OPENMS_DLLAPI MzTabMMetaData
93  {
94  public:
96 
101  std::map<Size, MzTabParameterList> sample_processing;
102  std::map<Size, MzTabInstrumentMetaData> instrument;
103  std::map<Size, MzTabSoftwareMetaData> software;
104  std::map<Size, MzTabString> publication;
105  std::map<Size, MzTabContactMetaData> contact;
106  std::map<Size, MzTabString> uri;
107  std::map<Size, MzTabString> external_study_uri;
109  std::map<Size, MzTabSampleMetaData> sample;
110  std::map<Size, MzTabMMSRunMetaData> ms_run;
111  std::map<Size, MzTabMAssayMetaData> assay;
112  std::map<Size, MzTabMStudyVariableMetaData> study_variable;
113  std::map<Size, MzTabParameter> custom;
114  std::map<Size, MzTabCVMetaData> cv;
115  std::map<Size, MzTabMDatabaseMetaData> database;
116  std::map<Size, MzTabParameter> derivatization_agent;
120  std::map<Size, MzTabParameter> id_confidence_measure;
121  std::vector<MzTabString> colunit_small_molecule;
122  std::vector<MzTabString> colunit_small_molecule_feature;
123  std::vector<MzTabString> colunit_small_molecule_evidence;
124  };
125 
129  class OPENMS_DLLAPI MzTabMSmallMoleculeSectionRow
130  {
131  public:
142  // Reliability information of the used indentificavtion method has to be stored in the ID data structure
146  std::map<Size, MzTabDouble> small_molecule_abundance_assay;
147  std::map<Size, MzTabDouble> small_molecule_abundance_study_variable;
149  std::vector<MzTabOptionalColumnEntry> opt_;
150  };
151 
156  {
157  public:
168  std::map<Size, MzTabDouble> small_molecule_feature_abundance_assay;
169  std::vector<MzTabOptionalColumnEntry> opt_;
170  };
171 
176  {
177  public:
194  std::map<Size, MzTabDouble> id_confidence_measure;
196  std::vector<MzTabOptionalColumnEntry> opt_;
197  };
198 
199  typedef std::vector<MzTabMSmallMoleculeSectionRow> MzTabMSmallMoleculeSectionRows;
200  typedef std::vector<MzTabMSmallMoleculeFeatureSectionRow> MzTabMSmallMoleculeFeatureSectionRows;
201  typedef std::vector<MzTabMSmallMoleculeEvidenceSectionRow> MzTabMSmallMoleculeEvidenceSectionRows;
202 
207  class OPENMS_DLLAPI MzTabM : public MzTabBase
208  {
209  public:
211  MzTabM() = default;
212 
214  ~MzTabM() = default;
215 
217  const MzTabMMetaData& getMetaData() const;
218 
220  void setMetaData(const MzTabMMetaData& m_md);
221 
224 
227 
230 
233 
236 
239 
241  void setCommentRows(const std::map<Size, String>& com);
242 
244  void setEmptyRows(const std::vector<Size>& empty);
245 
247  const std::vector<Size>& getEmptyRows() const;
248 
250  const std::map<Size, String>& getCommentRows() const;
251 
253  std::vector<String> getMSmallMoleculeOptionalColumnNames() const;
254 
256  std::vector<String> getMSmallMoleculeFeatureOptionalColumnNames() const;
257 
259  std::vector<String> getMSmallMoleculeEvidenceOptionalColumnNames() const;
260 
261  static void addMetaInfoToOptionalColumns(const std::set<String>& keys,
262  std::vector<MzTabOptionalColumnEntry>& opt,
263  const String& id, const MetaInfoInterface& meta);
264 
270  static MzTabM exportFeatureMapToMzTabM(const FeatureMap& feature_map);
271 
272  protected:
277  std::vector<Size> empty_rows_;
278  std::map<Size, String> comment_rows_;
279  std::vector<String> sml_optional_column_names_;
280  std::vector<String> smf_optional_column_names_;
281  std::vector<String> sme_optional_column_names_;
282 
284 
285  static void getFeatureMapMetaValues_(const FeatureMap& feature_map,
286  std::set<String>& feature_user_value_keys,
287  std::set<String>& observationmatch_user_value_keys,
288  std::set<String>& compound_user_value_keys);
289 
290  };
291 } // namespace OpenMS
A container for features.
Definition: FeatureMap.h:80
Interface for classes that can store arbitrary meta information (Type-Name-Value tuples).
Definition: MetaInfoInterface.h:35
Definition: MzTabBase.h:361
Definition: MzTabBase.h:79
Definition: MzTabBase.h:41
Definition: MzTabBase.h:101
MztabM Metadata.
Definition: MzTabM.h:93
std::map< Size, MzTabCVMetaData > cv
Controlled Vocabulary details.
Definition: MzTabM.h:114
std::vector< MzTabString > colunit_small_molecule
Defines the unit used for a specific column.
Definition: MzTabM.h:121
MzTabString mz_tab_version
MzTab-M Version.
Definition: MzTabM.h:97
std::map< Size, MzTabMAssayMetaData > assay
Assay details.
Definition: MzTabM.h:111
std::vector< MzTabString > colunit_small_molecule_evidence
Defines the unit used for a specific column.
Definition: MzTabM.h:123
std::map< Size, MzTabParameter > id_confidence_measure
Confidence measures / scores.
Definition: MzTabM.h:120
std::map< Size, MzTabMStudyVariableMetaData > study_variable
Study Variable details.
Definition: MzTabM.h:112
MzTabParameter quantification_method
Quantification method used in the experiment.
Definition: MzTabM.h:108
std::map< Size, MzTabString > publication
Associated publication(s)
Definition: MzTabM.h:104
MzTabString mz_tab_id
MzTab-M file id (e.g. repository-, local identifier)
Definition: MzTabM.h:98
std::map< Size, MzTabMDatabaseMetaData > database
Database details.
Definition: MzTabM.h:115
MzTabString description
Description.
Definition: MzTabM.h:100
std::map< Size, MzTabContactMetaData > contact
Contact name.
Definition: MzTabM.h:105
std::vector< MzTabString > colunit_small_molecule_feature
Defines the unit used for a specific column.
Definition: MzTabM.h:122
MzTabParameter small_molecule_quantification_unit
Description of the unit type used.
Definition: MzTabM.h:117
std::map< Size, MzTabParameterList > sample_processing
List of parameters describing the sample processing/preparation/handling.
Definition: MzTabM.h:101
std::map< Size, MzTabInstrumentMetaData > instrument
List of parameters describing the instrument.
Definition: MzTabM.h:102
std::map< Size, MzTabParameter > custom
Custom parameters.
Definition: MzTabM.h:113
std::map< Size, MzTabSampleMetaData > sample
Sample details.
Definition: MzTabM.h:109
std::map< Size, MzTabMMSRunMetaData > ms_run
MS run details.
Definition: MzTabM.h:110
MzTabString title
Title.
Definition: MzTabM.h:99
std::map< Size, MzTabString > external_study_uri
Pointing to an external file with more details about the study (e.g. ISA-TAB file)
Definition: MzTabM.h:107
MzTabParameter small_molecule_identification_reliability
Reliability of identification (4-level schema)
Definition: MzTabM.h:119
MzTabParameter small_molecule_feature_quantification_unit
Description of the unit type used.
Definition: MzTabM.h:118
std::map< Size, MzTabString > uri
Pointing to file source (e.g. MetaboLights)
Definition: MzTabM.h:106
std::map< Size, MzTabParameter > derivatization_agent
A description of derivatization agents applied to small molecules.
Definition: MzTabM.h:116
std::map< Size, MzTabSoftwareMetaData > software
Software used to analyze the data.
Definition: MzTabM.h:103
Data model of MzTab-M files Please see the MzTab-M specification at https://github....
Definition: MzTabM.h:208
MzTabMSmallMoleculeFeatureSectionRows m_small_molecule_feature_data_
Definition: MzTabM.h:275
const std::map< Size, String > & getCommentRows() const
Get comment rows.
MzTabM()=default
Default constructor.
std::vector< Size > empty_rows_
index of empty rows
Definition: MzTabM.h:277
void setMetaData(const MzTabMMetaData &m_md)
Set MzTabMMetaData.
const std::vector< Size > & getEmptyRows() const
Get empty rows.
~MzTabM()=default
Destructor.
static void addMetaInfoToOptionalColumns(const std::set< String > &keys, std::vector< MzTabOptionalColumnEntry > &opt, const String &id, const MetaInfoInterface &meta)
const MzTabMMetaData & getMetaData() const
Extract MzTabMMetaData.
static String getAdductString_(const IdentificationDataInternal::ObservationMatchRef &match_ref)
std::map< Size, String > comment_rows_
comments
Definition: MzTabM.h:278
MzTabMSmallMoleculeEvidenceSectionRows m_small_molecule_evidence_data_
Definition: MzTabM.h:276
void setMSmallMoleculeEvidenceSectionRows(const MzTabMSmallMoleculeEvidenceSectionRows &m_smesd)
Set MzTabMSmallMoleculeEvidenceSectionRows.
std::vector< String > getMSmallMoleculeFeatureOptionalColumnNames() const
Extract opt_ (custom, optional column names)
MzTabMSmallMoleculeSectionRows m_small_molecule_data_
Definition: MzTabM.h:274
static MzTabM exportFeatureMapToMzTabM(const FeatureMap &feature_map)
Export FeatureMap with Identifications to MzTabM.
const MzTabMSmallMoleculeSectionRows & getMSmallMoleculeSectionRows() const
Extract MzTabMSmallMoleculeSectionRows.
const MzTabMSmallMoleculeEvidenceSectionRows & getMSmallMoleculeEvidenceSectionRows() const
Extract MzTabMSmallMoleculeEvidenceSectionRows.
static void getFeatureMapMetaValues_(const FeatureMap &feature_map, std::set< String > &feature_user_value_keys, std::set< String > &observationmatch_user_value_keys, std::set< String > &compound_user_value_keys)
std::vector< String > smf_optional_column_names_
Definition: MzTabM.h:280
std::vector< String > sml_optional_column_names_
Definition: MzTabM.h:279
MzTabMMetaData m_meta_data_
Definition: MzTabM.h:273
void setEmptyRows(const std::vector< Size > &empty)
Set empty rows.
void setMSmallMoleculeFeatureSectionRows(const MzTabMSmallMoleculeFeatureSectionRows &m_smfsd)
Set MzTabMSmallMoleculeFeatureSectionRows.
std::vector< String > getMSmallMoleculeEvidenceOptionalColumnNames() const
Extract opt_ (custom, optional column names)
std::vector< String > sme_optional_column_names_
Definition: MzTabM.h:281
std::vector< String > getMSmallMoleculeOptionalColumnNames() const
Extract opt_ (custom, optional column names)
void setCommentRows(const std::map< Size, String > &com)
Set comment rows.
void setMSmallMoleculeSectionRows(const MzTabMSmallMoleculeSectionRows &m_smsd)
Set MzTabMSmallMoleculeSectionRows.
const MzTabMSmallMoleculeFeatureSectionRows & getMSmallMoleculeFeatureSectionRows() const
Extract MzTabMSmallMoleculeFeatureSectionRows.
Definition: MzTabBase.h:243
Definition: MzTabBase.h:206
Definition: MzTabBase.h:292
Definition: MzTabBase.h:266
Definition: MzTabBase.h:180
A more convenient string class.
Definition: String.h:34
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
MzTabSpectraRef spectra_ref
Reference to a spectrum.
Definition: MzTabM.h:191
MzTabDouble calc_mass_to_charge
Precursor ion’s m/z.
Definition: MzTabM.h:190
std::map< Size, MzTabParameter > scan_polarity
The polarity mode of a given run.
Definition: MzTabM.h:58
MzTabString inchi
InChi of the potential compound identifications.
Definition: MzTabM.h:183
MzTabString prefix
The prefix used in the “identifier” column of data tables.
Definition: MzTabM.h:84
MzTabStringList adducts
Adducts.
Definition: MzTabM.h:141
MzTabStringList inchi
InChi of the potential compound identifications.
Definition: MzTabM.h:137
MzTabParameter isotopomer
If de-isotoping has not been performed, then the isotopomer quantified MUST be reported here.
Definition: MzTabM.h:162
MzTabString name
Name of the assay.
Definition: MzTabM.h:40
MzTabString external_uri
A reference to further information about the assay.
Definition: MzTabM.h:42
MzTabParameter format
Parameter specifying the data format of the external MS data file.
Definition: MzTabM.h:55
MzTabParameter derivatized_form
derivatized form.
Definition: MzTabM.h:186
std::map< Size, MzTabDouble > small_molecule_feature_abundance_assay
Feature abundance in every assay.
Definition: MzTabM.h:168
MzTabString sml_identifier
The small molecule’s identifier.
Definition: MzTabM.h:132
MzTabParameter ms_level
The highest MS level used to inform identification.
Definition: MzTabM.h:193
MzTabString smiles
Potential molecular structure as SMILES.
Definition: MzTabM.h:182
MzTabString uri
The URI to the database.
Definition: MzTabM.h:86
std::map< Size, MzTabParameter > fragmentation_method
The type of fragmentation used in a given ms run.
Definition: MzTabM.h:57
std::vector< int > assay_refs
References to the IDs of assays grouped in the study variable.
Definition: MzTabM.h:70
MzTabString reliability
Reliability of the given small molecule identification.
Definition: MzTabM.h:143
std::map< Size, MzTabParameter > custom
Additional parameters or values for a given assay.
Definition: MzTabM.h:41
MzTabInteger sme_id_ref_ambiguity_code
Ambiguity in identifications.
Definition: MzTabM.h:160
MzTabStringList uri
The source entry’s location.
Definition: MzTabM.h:139
MzTabParameter id_format
Parameter specifying the id format used in the external data file.
Definition: MzTabM.h:56
MzTabInteger charge
Precursor ion’s charge.
Definition: MzTabM.h:164
MzTabParameter variation_function
The function used to calculate the study variable quantification variation value.
Definition: MzTabM.h:72
MzTabString adduct
Adduct.
Definition: MzTabM.h:161
MzTabInteger instrument_ref
Link to a specific instrument.
Definition: MzTabM.h:54
MzTabString description
A textual description of the study variable.
Definition: MzTabM.h:73
MzTabStringList chemical_name
Possible chemical/common names or general description.
Definition: MzTabM.h:138
MzTabDouble rt_end
The end time of the feature on the retention time axis.
Definition: MzTabM.h:167
MzTabDouble retention_time
Time point in seconds.
Definition: MzTabM.h:165
MzTabParameter identification_method
Database search, search engine or process that was used to identify this small molecule.
Definition: MzTabM.h:192
MzTabStringList sme_id_refs
Reference to the identification evidence.
Definition: MzTabM.h:159
MzTabParameter average_function
The function used to calculate the study variable quantification value.
Definition: MzTabM.h:71
MzTabString smf_identifier
Within file unique identifier for the small molecule feature.
Definition: MzTabM.h:158
std::map< Size, MzTabDouble > small_molecule_abundance_study_variable
The small molecule’s abundance in all the study variables described in the metadata section.
Definition: MzTabM.h:147
MzTabParameter database
The description of databases used.
Definition: MzTabM.h:83
MzTabDouble rt_start
The start time of the feature on the retention time axis.
Definition: MzTabM.h:166
std::map< Size, MzTabDouble > small_molecule_abundance_variation_study_variable
A measure of the variability of the study variable abundance measurement.
Definition: MzTabM.h:148
MzTabString database_identifier
The putative identification for the small molecule sourced from an external database.
Definition: MzTabM.h:180
std::vector< MzTabMSmallMoleculeFeatureSectionRow > MzTabMSmallMoleculeFeatureSectionRows
Definition: MzTabM.h:200
MzTabStringList database_identifier
Names of the used databases.
Definition: MzTabM.h:134
MzTabStringList smiles
Molecular structure in SMILES format.
Definition: MzTabM.h:136
MzTabString location
Location of the external data file.
Definition: MzTabM.h:53
std::vector< MzTabMSmallMoleculeEvidenceSectionRow > MzTabMSmallMoleculeEvidenceSectionRows
Definition: MzTabM.h:201
MzTabParameter hash_method
Parameter specifying the hash methods.
Definition: MzTabM.h:60
MzTabDoubleList theoretical_neutral_mass
Precursor theoretical neutral mass.
Definition: MzTabM.h:140
MzTabDouble exp_mass_to_charge
Precursor ion’s m/z.
Definition: MzTabM.h:163
MzTabDouble best_id_confidence_value
The best confidence measure.
Definition: MzTabM.h:145
MzTabStringList smf_id_refs
References to all the features on which quantification has been based.
Definition: MzTabM.h:133
std::vector< MzTabOptionalColumnEntry > opt_
Optional columns must start with “opt_”.
Definition: MzTabM.h:149
MzTabString chemical_name
Possible chemical/common names or general description.
Definition: MzTabM.h:184
std::vector< MzTabMSmallMoleculeSectionRow > MzTabMSmallMoleculeSectionRows
Definition: MzTabM.h:199
MzTabString chemical_formula
The putative molecular formula.
Definition: MzTabM.h:181
MzTabString hash
Hash value of the corresponding external MS data file.
Definition: MzTabM.h:59
MzTabString sme_identifier
Within file unique identifier for the small molecule evidence result.
Definition: MzTabM.h:178
MzTabString evidence_input_id
Within file unique identifier for the input data used to support this identification e....
Definition: MzTabM.h:179
std::map< Size, MzTabDouble > small_molecule_abundance_assay
The small molecule’s abundance in every assay described in the metadata section.
Definition: MzTabM.h:146
MzTabParameterList factors
Additional parameters or factors.
Definition: MzTabM.h:74
MzTabInteger sample_ref
An association from a given assay to the sample analysed.
Definition: MzTabM.h:43
std::map< Size, MzTabDouble > id_confidence_measure
Statistical value or score for the identification.
Definition: MzTabM.h:194
MzTabString version
The database version.
Definition: MzTabM.h:85
MzTabInteger rank
Rank of the identification (1 = best)
Definition: MzTabM.h:195
MzTabParameter best_id_confidence_measure
The identification approach with the highest confidence.
Definition: MzTabM.h:144
MzTabInteger ms_run_ref
An association from a given assay to the source MS run.
Definition: MzTabM.h:44
MzTabStringList chemical_formula
Potential chemical formula of the reported compound.
Definition: MzTabM.h:135
MztabM Assay Metadata.
Definition: MzTabM.h:38
MztabM Database Metadata.
Definition: MzTabM.h:81
MztabM MSRun Metadata.
Definition: MzTabM.h:51
SME Small molecule evidence section (mztab-m)
Definition: MzTabM.h:176
SMF Small molecule feature section (mztab-m)
Definition: MzTabM.h:156
SML Small molecule section (mztab-m)
Definition: MzTabM.h:130
MztabM StudyVariable Metadata.
Definition: MzTabM.h:67
Data model of MzTabM files. Please see the official MzTabM specification at https://github....
Definition: MzTabM.h:27
bool operator()(const IdentificationDataInternal::ObservationMatchRef &lhs, const IdentificationDataInternal::ObservationMatchRef &rhs) const
Definition: MzTabM.h:28
Wrapper that adds operator< to iterators, so they can be used as (part of) keys in maps/sets or multi...
Definition: MetaData.h:20