OpenMS
OpenSwathTSVWriter.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: 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 
110  public:
111 
112  OpenSwathTSVWriter(const String& output_filename,
113  const String& input_filename = "inputfile",
114  bool ms1_scores = false);
115 
116  bool isActive() const;
117 
122  void writeHeader();
123 
139  const OpenSwath::LightTransition * transition,
140  const FeatureMap& output, const String& id) const;
141 
152  void writeLines(const std::vector<String>& to_output);
153 
154  };
155 
156 }
157 
158 
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.
OpenSwathTSVWriter(const String &output_filename, const String &input_filename="inputfile", bool ms1_scores=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: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
Definition: TransitionExperiment.h:127
Definition: TransitionExperiment.h:20