OpenMS
OpenSwathOSWWriter.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: George Rosenberger $
6 // $Authors: George Rosenberger $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 // Interfaces
13 
15 
17 
18 #include <fstream>
19 
20 namespace OpenMS
21 {
22 
89  class OPENMS_DLLAPI OpenSwathOSWWriter
90  {
94  bool doWrite_;
96  bool sonar_;
98 
99  public:
100 
101  OpenSwathOSWWriter(const String& output_filename,
102  const UInt64 run_id,
103  const String& input_filename = "inputfile",
104  bool ms1_scores = false,
105  bool sonar = false,
106  bool uis_scores = false);
107 
108  bool isActive() const;
109 
114  void writeHeader();
115 
127  String getScore(const Feature& feature, const std::string& score_name) const;
128 
140  std::vector<String> getSeparateScore(const Feature& feature, const std::string& score_name) const;
141 
157  const OpenSwath::LightTransition* /* transition */,
158  const FeatureMap& output, const String& id) const;
159 
173  void writeLines(const std::vector<String>& to_osw_output);
174 
175  };
176 
177 }
178 
A container for features.
Definition: FeatureMap.h:80
An LC-MS feature.
Definition: Feature.h:46
Class to write out an OpenSwath OSW SQLite output (PyProphet input).
Definition: OpenSwathOSWWriter.h:90
String input_filename_
Definition: OpenSwathOSWWriter.h:92
std::vector< String > getSeparateScore(const Feature &feature, const std::string &score_name) const
Prepare concatenated scores for SQLite insertion.
void writeHeader()
Initializes file by generating SQLite tables.
bool sonar_
Definition: OpenSwathOSWWriter.h:96
String output_filename_
Definition: OpenSwathOSWWriter.h:91
bool enable_uis_scoring_
Definition: OpenSwathOSWWriter.h:97
bool use_ms1_traces_
Definition: OpenSwathOSWWriter.h:95
String getScore(const Feature &feature, const std::string &score_name) const
Prepare scores for SQLite insertion.
OpenSwathOSWWriter(const String &output_filename, const UInt64 run_id, const String &input_filename="inputfile", bool ms1_scores=false, bool sonar=false, bool uis_scores=false)
void writeLines(const std::vector< String > &to_osw_output)
Write data to disk.
OpenMS::UInt64 run_id_
Definition: OpenSwathOSWWriter.h:93
String prepareLine(const OpenSwath::LightCompound &, const OpenSwath::LightTransition *, const FeatureMap &output, const String &id) const
Prepare a single line (feature) for output.
bool doWrite_
Definition: OpenSwathOSWWriter.h:94
A more convenient string class.
Definition: String.h:34
OPENMS_UINT64_TYPE UInt64
Unsigned integer type (64bit)
Definition: Types.h:51
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22
Definition: TransitionExperiment.h:127
Definition: TransitionExperiment.h:20