OpenMS
Loading...
Searching...
No Matches
MRMFeatureQCFile.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- 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
15
16namespace OpenMS
17{
25 class OPENMS_DLLAPI MRMFeatureQCFile :
26 private CsvFile,
27 public ProgressLogger
28 {
29public:
31 MRMFeatureQCFile() = default;
33 ~MRMFeatureQCFile() override = default;
34
45 void load(const std::string& filename, MRMFeatureQC& mrmfqc, const bool is_component_group) const;
46
47 /*
48 @brief Stores an MRMFeatureQC file.
49
50 @exception Exception::UnableToCreateFile is thrown if the file could not be created
51
52 @param[in] filename The path to the input file
53 @param[in] mrmfqc The output class which will contain the criteria
54 @param[in] is_component_group true if the user intends to store ComponentGroupQCs data, false otherwise
55 */
56 void store(const std::string& filename, const MRMFeatureQC& mrmfqc, const bool is_component_group);
57protected:
68 const StringList& line,
69 const std::map<std::string, Size>& headers,
70 std::vector<MRMFeatureQC::ComponentQCs>& c_qcs
71 ) const;
72
83 const StringList& line,
84 const std::map<std::string, Size>& headers,
85 std::vector<MRMFeatureQC::ComponentGroupQCs>& cg_qcs
86 ) const;
87
103 const std::string& key,
104 const std::string& value,
105 const std::string& boundary,
106 std::map<std::string, std::pair<double,double>>& meta_values_qc
107 ) const;
108
124 const std::map<std::string, Size>& headers,
125 const StringList& line,
126 const std::string& header,
127 const Int default_value
128 ) const;
129
145 const std::map<std::string, Size>& headers,
146 const StringList& line,
147 const std::string& header,
148 const double default_value
149 ) const;
150
165 std::string getCastValue_(
166 const std::map<std::string, Size>& headers,
167 const StringList& line,
168 const std::string& header,
169 const std::string& default_value
170 ) const;
171
172 };
173
174} // namespace OpenMS
175
This class handles csv files. Currently only loading is implemented. Does NOT support comment lines!
Definition CsvFile.h:25
File adapter for MRMFeatureQC files.
Definition MRMFeatureQCFile.h:28
void pushValuesFromLine_(const StringList &line, const std::map< std::string, Size > &headers, std::vector< MRMFeatureQC::ComponentQCs > &c_qcs) const
Save values from a line to a ComponentQCs.
Int getCastValue_(const std::map< std::string, Size > &headers, const StringList &line, const std::string &header, const Int default_value) const
Extracts a column's value from a line.
double getCastValue_(const std::map< std::string, Size > &headers, const StringList &line, const std::string &header, const double default_value) const
Extracts a column's value from a line.
std::string getCastValue_(const std::map< std::string, Size > &headers, const StringList &line, const std::string &header, const std::string &default_value) const
Extracts a column's value from a line.
MRMFeatureQCFile()=default
Default constructor.
void setPairValue_(const std::string &key, const std::string &value, const std::string &boundary, std::map< std::string, std::pair< double, double > > &meta_values_qc) const
Set one of the values in a pair.
void load(const std::string &filename, MRMFeatureQC &mrmfqc, const bool is_component_group) const
Loads an MRMFeatureQC file.
~MRMFeatureQCFile() override=default
Destructor.
void pushValuesFromLine_(const StringList &line, const std::map< std::string, Size > &headers, std::vector< MRMFeatureQC::ComponentGroupQCs > &cg_qcs) const
Save values from a line to a ComponentGroupQCs.
void store(const std::string &filename, const MRMFeatureQC &mrmfqc, const bool is_component_group)
The MRMFeatureQC is a class to handle the parameters and options for MRMFeatureFilter.
Definition MRMFeatureQC.h:60
Base class for all classes that want to report their progress.
Definition ProgressLogger.h:27
int Int
Signed integer type.
Definition Types.h:72
std::vector< std::string > StringList
Vector of String.
Definition ListUtils.h:44
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19