OpenMS
ExperimentalDesignFile.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: Timo Sachsenberg $
6 // $Authors: Timo Sachsenberg, Lukas Zimmermann $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
12 
13 #include <map>
14 #include <set>
15 
16 namespace OpenMS
17 {
18  class ExperimentalDesign;
19  class TextFile;
26  class OPENMS_DLLAPI ExperimentalDesignFile
27  {
28  public:
29 
31  static ExperimentalDesign load(const String& tsv_file, bool require_spectra_files);
32 
34  static ExperimentalDesign load(const TextFile& text_file, const bool require_spectra_file, String filename);
35 
36  private:
37  static bool isOneTableFile_(const TextFile& text_file);
38  static ExperimentalDesign parseOneTableFile_(const TextFile& text_file, const String& tsv_file, bool require_spectra_file);
39  static ExperimentalDesign parseTwoTableFile_(const TextFile& text_file, const String& tsv_file, bool require_spectra_file);
42  static void parseHeader_(
43  const StringList &header,
44  const String &filename,
45  std::map <String, Size> &column_map,
46  const std::set <String> &required,
47  const std::set <String> &optional,
48  bool allow_other_header);
49 
51  static void parseErrorIf_(const bool test, const String &filename, const String &message);
52  };
53 }
54 
Load an experimental design from a TSV file. (see ExperimentalDesign for details on the supported for...
Definition: ExperimentalDesignFile.h:27
static ExperimentalDesign load(const String &tsv_file, bool require_spectra_files)
Loads an experimental design from a tabular separated file.
static ExperimentalDesign load(const TextFile &text_file, const bool require_spectra_file, String filename)
Loads an experimental design from an already loaded or generated, tabular file.
static void parseHeader_(const StringList &header, const String &filename, std::map< String, Size > &column_map, const std::set< String > &required, const std::set< String > &optional, bool allow_other_header)
static void parseErrorIf_(const bool test, const String &filename, const String &message)
static ExperimentalDesign parseTwoTableFile_(const TextFile &text_file, const String &tsv_file, bool require_spectra_file)
static bool isOneTableFile_(const TextFile &text_file)
static ExperimentalDesign parseOneTableFile_(const TextFile &text_file, const String &tsv_file, bool require_spectra_file)
Representation of an experimental design in OpenMS. Instances can be loaded with the ExperimentalDesi...
Definition: ExperimentalDesign.h:219
A more convenient string class.
Definition: String.h:34
Definition: TextFile.h:21
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:44
bool test
Status of the current subsection.
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19