OpenMS  3.0.0
SiriusMSConverter.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2022.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Oliver Alka $
32 // $Authors: Oliver Alka $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
40 #include <fstream>
41 
42 namespace OpenMS
43 {
44 
45  class OPENMS_DLLAPI SiriusMSFile
46  {
47 public:
48 
51  {
52  public:
59  };
60 
64  {
65  public:
67  double pmass;
68  double pint_mono;
69  double rt;
70  double fmz;
73  int charge;
79  std::vector<String> native_ids;
81  std::vector<String> m_ids;
83  std::vector<String> scan_indices;
84  std::vector<String> specrefs;
85  };
86 
109  static void store(const MSExperiment& spectra,
110  const OpenMS::String& msfile,
111  const FeatureMapping::FeatureToMs2Indices& feature_mapping,
112  const bool& feature_only,
113  const int& isotope_pattern_iterations,
114  const bool no_mt_info,
115  std::vector<SiriusMSFile::CompoundInfo>& v_cmpinfo);
116 
117 
118  protected:
143  static void writeMsFile_(std::ofstream& os,
144  const MSExperiment& spectra,
145  const std::vector<size_t>& ms2_spectra_index,
146  const SiriusMSFile::AccessionInfo& ainfo,
147  const StringList& adducts,
148  const std::vector<String>& v_description,
149  const std::vector<String>& v_sumformula,
150  const std::vector<std::pair<double,double>>& f_isotopes,
151  int& feature_charge,
152  uint64_t& feature_id,
153  const double& feature_rt,
154  const double& feature_mz,
155  bool& writecompound,
156  const bool& no_masstrace_info_isotope_pattern,
157  const int& isotope_pattern_iterations,
158  int& count_skipped_spectra,
159  int& count_assume_mono,
160  int& count_no_ms1,
161  std::vector<SiriusMSFile::CompoundInfo>& v_cmpinfo);
162 
163 
164 
173  static Int getHighestIntensityPeakInMZRange_(double test_mz,
174  const MSSpectrum& spectrum,
175  double tolerance,
176  bool ppm);
177 
187  static std::vector<Peak1D> extractPrecursorIsotopePattern_(const double& precursor_mz,
188  const MSSpectrum& precursor_spectrum,
189  int& iterations,
190  const int& charge);
191 
192 
193 
194  };
195 
196 } // namespace OpenMS
OpenMS::SiriusMSFile::AccessionInfo
< class to store information about accessions
Definition: SiriusMSConverter.h:50
OpenMS::SiriusMSFile
Definition: SiriusMSConverter.h:45
OpenMS::SiriusMSFile::CompoundInfo::formula
String formula
sumformula of the compound
Definition: SiriusMSConverter.h:72
OpenMS::SiriusMSFile::CompoundInfo::specrefs
std::vector< String > specrefs
spectra reference for mztab-m
Definition: SiriusMSConverter.h:84
OpenMS::SiriusMSFile::CompoundInfo::native_ids
std::vector< String > native_ids
native ids of the associated spectra
Definition: SiriusMSConverter.h:79
OpenMS::SiriusMSFile::AccessionInfo::native_id_type
String native_id_type
nativeID type for mztab-m
Definition: SiriusMSConverter.h:58
OpenMS::String
A more convenient string class.
Definition: String.h:58
OpenMS::MSExperiment
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:70
OpenMS::SiriusMSFile::CompoundInfo::ionization
String ionization
adduct information
Definition: SiriusMSConverter.h:74
OpenMS::FeatureMapping::FeatureToMs2Indices
Stores preprocessed feature mapping information.
Definition: FeatureMapping.h:58
OpenMS::SiriusMSFile::CompoundInfo::native_ids_id
String native_ids_id
concatenated list of the associated spectra
Definition: SiriusMSConverter.h:80
OpenMS::SiriusMSFile::CompoundInfo::pmass
double pmass
parent/precursor mass of the compound
Definition: SiriusMSConverter.h:67
OpenMS::Int
int Int
Signed integer type.
Definition: Types.h:102
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
OpenMS::SiriusMSFile::CompoundInfo::scan_indices
std::vector< String > scan_indices
index of the associated spectra
Definition: SiriusMSConverter.h:83
OpenMS::SiriusMSFile::CompoundInfo::cmp
String cmp
query_id used compound in .ms file
Definition: SiriusMSConverter.h:66
OpenMS::SiriusMSFile::AccessionInfo::native_id_accession
String native_id_accession
nativeID accession for mztab-m
Definition: SiriusMSConverter.h:57
OpenMS::SiriusMSFile::CompoundInfo::source_format
String source_format
format of the sourcefile for mztab-m
Definition: SiriusMSConverter.h:78
OpenMS::SiriusMSFile::CompoundInfo::rt
double rt
retention time of the compound
Definition: SiriusMSConverter.h:69
OpenMS::SiriusMSFile::CompoundInfo::source_file
String source_file
sourcefile for mztab-m
Definition: SiriusMSConverter.h:77
OpenMS::SiriusMSFile::AccessionInfo::sf_filename
String sf_filename
sourcefile name for mztab-m
Definition: SiriusMSConverter.h:55
OpenMS::SiriusMSFile::AccessionInfo::sf_accession
String sf_accession
sourcefile accessions for mztab-m
Definition: SiriusMSConverter.h:56
SpectrumLookup.h
OpenMS::SiriusMSFile::CompoundInfo::m_ids_id
String m_ids_id
concatenated list of native ids and identifier for multiple possible identification via AMS ("|" sepa...
Definition: SiriusMSConverter.h:82
OpenMS::SiriusMSFile::CompoundInfo::fid
String fid
annotated feature_id (if available)
Definition: SiriusMSConverter.h:71
OpenMS::StringList
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:70
OpenMS::SiriusMSFile::CompoundInfo::m_ids
std::vector< String > m_ids
native ids and identifier for multiple possible identification via AMS ("|" separator)
Definition: SiriusMSConverter.h:81
FeatureMapping.h
OpenMS::SiriusMSFile::CompoundInfo::pint_mono
double pint_mono
parent/precursor intensity of the compound
Definition: SiriusMSConverter.h:68
OpenMS::SiriusMSFile::CompoundInfo::des
String des
description/name of the compound
Definition: SiriusMSConverter.h:75
OpenMS::SiriusMSFile::CompoundInfo
Definition: SiriusMSConverter.h:63
OpenMS::SiriusMSFile::AccessionInfo::sf_path
String sf_path
sourcefile path for mztab-m
Definition: SiriusMSConverter.h:53
OpenMS::SiriusMSFile::CompoundInfo::charge
int charge
precursor/feature charge
Definition: SiriusMSConverter.h:73
OpenMS::SiriusMSFile::AccessionInfo::sf_type
String sf_type
sourcefile type for mztab-m
Definition: SiriusMSConverter.h:54
OpenMS::MSSpectrum
The representation of a 1D spectrum.
Definition: MSSpectrum.h:66
OpenMS::SiriusMSFile::CompoundInfo::fmz
double fmz
annotated mass of a feature (if available)
Definition: SiriusMSConverter.h:70
OpenMS::SiriusMSFile::CompoundInfo::specref_format
String specref_format
spectra ref format for mztab-m
Definition: SiriusMSConverter.h:76
StandardTypes.h