OpenMS
MRMFeaturePickerFile.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: Douglas McCloskey, Pasquale Domenico Colaianni $
6 // $Authors: Douglas McCloskey, Pasquale Domenico Colaianni $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 #include <OpenMS/config.h> // OPENMS_DLLAPI
13 #include <OpenMS/FORMAT/CsvFile.h>
14 #include <map>
15 
16 namespace OpenMS
17 {
35  class OPENMS_DLLAPI MRMFeaturePickerFile :
36  public CsvFile
37  {
38 public:
40  MRMFeaturePickerFile() = default;
42  ~MRMFeaturePickerFile() override = default;
43 
59  void load(
60  const String& filename,
61  std::vector<MRMFeaturePicker::ComponentParams>& cp_list,
62  std::vector<MRMFeaturePicker::ComponentGroupParams>& cgp_list
63  );
64 
65 protected:
77  const StringList& line,
78  const std::map<String, Size>& headers,
81  ) const;
82 
91  void setCastValue_(const String& key, const String& value, Param& params) const;
92  };
93 }
94 
This class handles csv files. Currently only loading is implemented. Does NOT support comment lines!
Definition: CsvFile.h:25
MRMFeaturePickerFile loads components and components groups parameters from a .csv file.
Definition: MRMFeaturePickerFile.h:37
bool extractParamsFromLine_(const StringList &line, const std::map< String, Size > &headers, MRMFeaturePicker::ComponentParams &cp, MRMFeaturePicker::ComponentGroupParams &cgp) const
Extracts the information from a StringList and saves it into the correct data structures.
MRMFeaturePickerFile()=default
Constructor.
void setCastValue_(const String &key, const String &value, Param &params) const
Helper method which takes care of converting the given value to the desired type, based on the header...
void load(const String &filename, std::vector< MRMFeaturePicker::ComponentParams > &cp_list, std::vector< MRMFeaturePicker::ComponentGroupParams > &cgp_list)
Loads the file's data and saves it into vectors of ComponentParams and ComponentGroupParams.
~MRMFeaturePickerFile() override=default
Destructor.
Structure to contain information about a component group with its parameters.
Definition: MRMFeaturePicker.h:48
Structure to contain information about a single component with its parameters.
Definition: MRMFeaturePicker.h:40
Management and storage of parameters / INI files.
Definition: Param.h:44
A more convenient string class.
Definition: String.h:34
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:44
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19