35 #ifndef OPENMS_FORMAT_KROENIKFILE_H
36 #define OPENMS_FORMAT_KROENIKFILE_H
83 template <
typename FeatureMapType>
84 void load(
const String & filename, FeatureMapType & feature_map)
93 for (
Size i = 1; i < input.size(); ++i)
98 std::vector<String> parts;
99 line.
split(
'\t', parts);
101 if (parts.size() != 14)
104 String(
"Failed parsing in line ") +
String(i + 1) +
": missing 14 tab-separated entries (got " +
String(parts.size()) +
")\nLine was: '" + line +
"'");
110 f.
setRT(parts[11].toDouble());
116 point.
setX(parts[9].toDouble());
120 point.
setX(parts[9].toDouble());
124 point.
setX(parts[10].toDouble());
128 point.
setX(parts[10].toDouble());
132 point.
setX(parts[9].toDouble());
136 std::vector<ConvexHull2D> hulls;
137 hulls.push_back(hull);
144 feature_map.push_back(f);
147 LOG_INFO <<
"Hint: The convex hulls are approximated in m/z dimension (Kroenik lacks this information)!\n";
157 template <
typename SpectrumType>
158 void store(
const String & filename,
const SpectrumType & spectrum)
const
160 std::cerr <<
"Store() for KroenikFile not implemented. Filename was: " << filename <<
", spec of size " << spectrum.size() <<
"\n";
167 #endif // OPENMS_FORMAT_KROENIKFILE_H
const ChargeType & getCharge() const
Non-mutable access to charge state.
A more convenient string class.
Definition: String.h:56
void setMZ(CoordinateType coordinate)
Mutable access to the m/z coordinate (index 1)
Definition: Peak2D.h:197
#define LOG_INFO
Macro if a information, e.g. a status should be reported.
Definition: LogStream.h:455
void setY(CoordinateType c)
Name mutator for the second dimension. Only for DPosition<2>, for visualization.
Definition: DPosition.h:170
File adapter for Kroenik (HardKloer sibling) files.
Definition: KroenikFile.h:67
A 2-dimensional hull representation in [counter]clockwise direction - depending on axis labelling...
Definition: ConvexHull2D.h:75
const double PROTON_MASS_U
void setIntensity(IntensityType intensity)
Non-mutable access to the data point intensity (height)
Definition: Peak2D.h:167
void setRT(CoordinateType coordinate)
Mutable access to the RT coordinate (index 0)
Definition: Peak2D.h:209
void setX(CoordinateType c)
Name mutator for the first dimension. Only for DPosition<2>, for visualization.
Definition: DPosition.h:163
An LC-MS feature.
Definition: Feature.h:66
CoordinateType getMZ() const
Returns the m/z coordinate (index 1)
Definition: Peak2D.h:191
void store(const String &filename, const SpectrumType &spectrum) const
Stores a featureXML as a Kroenik file.
Definition: KroenikFile.h:158
void setConvexHulls(const std::vector< ConvexHull2D > &hulls)
Set the convex hulls of single mass traces.
bool addPoint(const PointType &point)
void setOverallQuality(QualityType q)
Set the overall quality.
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:144
void setCharge(const ChargeType &ch)
Set charge state.
void load(const String &filename, FeatureMapType &feature_map)
Loads a Kroenik file into a featureXML.
Definition: KroenikFile.h:84
bool split(const char splitter, std::vector< String > &substrings, bool quote_protect=false) const
Splits a string into substrings using splitter as delimiter.
Not implemented exception.
Definition: Exception.h:437
This class provides some basic file handling methods for text files.
Definition: TextFile.h:47
Parse Error exception.
Definition: Exception.h:608
double DoubleReal
Double-precision real type.
Definition: Types.h:118