OpenMS
OpenSwathTSVWriter.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: Hannes Roest $
6 // $Authors: Hannes Roest $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 // Interfaces
13 
15 
16 #include <fstream>
17 
18 namespace OpenMS
19 {
20 
103  class OPENMS_DLLAPI OpenSwathTSVWriter
104  {
105  std::ofstream ofs;
107  bool doWrite_;
109  bool sonar_;
110 
111  public:
112 
113  OpenSwathTSVWriter(const String& output_filename,
114  const String& input_filename = "inputfile",
115  bool ms1_scores = false,
116  bool sonar = false);
117 
118  bool isActive() const;
119 
124  void writeHeader();
125 
141  const OpenSwath::LightTransition * transition,
142  const FeatureMap& output, const String& id) const;
143 
154  void writeLines(const std::vector<String>& to_output);
155 
156  };
157 
158 }
159 
160 
A container for features.
Definition: FeatureMap.h:80
Class to write out an OpenSwath TSV output (mProphet input).
Definition: OpenSwathTSVWriter.h:104
String input_filename_
Definition: OpenSwathTSVWriter.h:106
String prepareLine(const OpenSwath::LightCompound &pep, const OpenSwath::LightTransition *transition, const FeatureMap &output, const String &id) const
Prepare a single line (feature) for output.
void writeHeader()
Initializes file by writing TSV header.
bool sonar_
Definition: OpenSwathTSVWriter.h:109
OpenSwathTSVWriter(const String &output_filename, const String &input_filename="inputfile", bool ms1_scores=false, bool sonar=false)
bool use_ms1_traces_
Definition: OpenSwathTSVWriter.h:108
void writeLines(const std::vector< String > &to_output)
Write data to disk.
std::ofstream ofs
Definition: OpenSwathTSVWriter.h:105
bool doWrite_
Definition: OpenSwathTSVWriter.h:107
A more convenient string class.
Definition: String.h:34
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22
Definition: TransitionExperiment.h:127
Definition: TransitionExperiment.h:20