OpenMS
OpenSwathOSWWriter.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, 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 
97  public:
98 
99  OpenSwathOSWWriter(const String& output_filename,
100  const UInt64 run_id,
101  const String& input_filename = "inputfile",
102  bool uis_scores = false);
103 
104  bool isActive() const;
105 
110  void writeHeader();
111 
123  String getScore(const Feature& feature, const std::string& score_name) const;
124 
136  std::vector<String> getSeparateScore(const Feature& feature, const std::string& score_name) const;
137 
153  const OpenSwath::LightTransition* transition,
154  const FeatureMap& output, const String& id) const;
155 
169  void writeLines(const std::vector<String>& to_osw_output);
170 
171  };
172 
173 }
174 
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
String prepareLine(const OpenSwath::LightCompound &pep, const OpenSwath::LightTransition *transition, const FeatureMap &output, const String &id) const
Prepare a single line (feature) for output.
OpenSwathOSWWriter(const String &output_filename, const UInt64 run_id, const String &input_filename="inputfile", bool uis_scores=false)
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.
String output_filename_
Definition: OpenSwathOSWWriter.h:91
bool enable_uis_scoring_
Definition: OpenSwathOSWWriter.h:95
String getScore(const Feature &feature, const std::string &score_name) const
Prepare scores for SQLite insertion.
void writeLines(const std::vector< String > &to_osw_output)
Write data to disk.
OpenMS::UInt64 run_id_
Definition: OpenSwathOSWWriter.h:93
bool doWrite_
Definition: OpenSwathOSWWriter.h:94
A more convenient string class.
Definition: String.h:34
uint64_t UInt64
Unsigned integer type (64bit)
Definition: Types.h:47
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
Definition: TransitionExperiment.h:127
Definition: TransitionExperiment.h:20