|
OpenMS
2.5.0
|
Go to the documentation of this file.
42 #include <type_traits>
70 template <
typename CONT_T,
typename TRAIT,
bool CONST_T = true >
78 using pointer =
typename std::conditional<CONST_T, typename CONT_T::value_type const*, typename CONT_T::value_type*>::type;
79 using reference =
typename std::conditional<CONST_T, typename CONT_T::value_type const&, typename CONT_T::value_type&>::type;
81 using CONT_IT =
typename std::conditional<CONST_T, typename CONT_T::const_iterator, typename CONT_T::iterator>::type;
138 if (
this == &rhs)
return true;
154 return !(*
this == rhs);
158 template<
bool _CONST = CONST_T >
159 typename std::enable_if< _CONST, reference >::type
operator*()
const
163 template<
bool _CONST = CONST_T >
164 typename std::enable_if< !_CONST, reference >::type
operator*()
170 template<
bool _CONST = CONST_T >
171 typename std::enable_if< _CONST, pointer >::type
operator->()
const
175 template<
bool _CONST = CONST_T >
176 typename std::enable_if< !_CONST, pointer >::type
operator->()
251 double max_dist = TRAIT::allowedTol(
tol_, *
it_ref_);
254 float diff = std::numeric_limits<float>::max();
274 if (diff <= max_dist)
return;
294 template <
typename T>
300 template <
typename T>
303 return fabs(elem_ref - elem_tgt);
311 template <
typename T>
317 template <
typename T>
320 return fabs(elem_ref.getMZ() - elem_tgt.getMZ());
328 template <
typename T>
334 template <
typename T>
337 return fabs(elem_ref.getMZ() - elem_tgt.getMZ());
typename CONT_T::value_type value_type
Definition: MatchedIterator.h:76
Management and storage of parameters / INI files.
Definition: Param.h:73
static FileTypes::Type getTypeByFileName(const String &filename)
Determines the file type from a file name.
void store(const String &filename, const ConsensusMap &consensus_map)
Stores a consensus map to file.
void setValue(const String &key, const DataValue &value, const String &description="", const StringList &tags=StringList())
Sets a value.
This class provides Input/Output functionality for feature maps.
Definition: FeatureXMLFile.h:68
std::enable_if< _CONST, reference >::type operator*() const
dereference current target element
Definition: MatchedIterator.h:159
bool operator==(const MatchedIterator &rhs) const
Definition: MatchedIterator.h:136
const Param & getParameters() const
Non-mutable access to the parameters.
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
OpenMS consensus map format (.consensusXML)
Definition: FileTypes.h:67
CONST_CONT_IT tgt_begin_
Definition: MatchedIterator.h:285
void run(const PeakMap &, std::vector< MassTrace > &, const Size max_traces=0)
Main method of MassTraceDetection. Extracts mass traces of a MSExperiment and gathers them into a vec...
void setPrimaryMSRunPath(const StringList &s)
set the file paths to the primary MS run (stored in ColumnHeaders)
void setOverallQuality(QualityType q)
Set the overall quality.
const std::vector< ConvexHull2D > & getConvexHulls() const
Non-mutable access to the convex hulls.
#define OPENMS_LOG_INFO
Macro if a information, e.g. a status should be reported.
Definition: LogStream.h:465
static float allowedTol(float tol, const T &)
Definition: MatchedIterator.h:329
void setMZ(CoordinateType coordinate)
Mutable access to the m/z coordinate (index 1)
Definition: Peak2D.h:202
void setIntensity(IntensityType intensity)
Non-mutable access to the data point intensity (height)
Definition: Peak2D.h:172
Definition: MatchedIterator.h:309
MatchedIterator & operator=(const MatchedIterator &rhs)=default
Assignment operator (default)
Size size() const
Definition: MSExperiment.h:127
void store(const String &filename, const FeatureMap &feature_map)
stores the map feature_map in file with name filename.
CoordinateType getMZ() const
Returns the m/z coordinate (index 1)
Definition: Peak2D.h:196
CONT_IT it_ref_
Definition: MatchedIterator.h:286
void detectPeaks(MassTrace &mt, std::vector< MassTrace > &single_mtraces)
Extracts chromatographic peaks from a single MassTrace and stores the resulting split traces in a vec...
For each element in the reference container the closest peak in the target will be searched....
Definition: MatchedIterator.h:71
size_t refIdx() const
index into reference container
Definition: MatchedIterator.h:188
A container for features.
Definition: FeatureMap.h:95
Size setUniqueId()
Assigns a new, valid unique id. Always returns 1.
Definition: UniqueIdInterface.h:146
MatchedIterator & operator++()
Advances to the next valid pair.
Definition: MatchedIterator.h:204
CONT_IT it_tgt_
Definition: MatchedIterator.h:286
void insert(const String &prefix, const Param ¶m)
Base class for TOPP applications.
Definition: TOPPBase.h:144
This class provides Input functionality for ConsensusMaps and Output functionality for alignments and...
Definition: ConsensusXMLFile.h:61
typename std::conditional< CONST_T, typename CONT_T::const_iterator, typename CONT_T::iterator >::type CONT_IT
Definition: MatchedIterator.h:81
An LC-MS feature.
Definition: Feature.h:70
Size applyMemberFunction(Size(Type::*member_function)())
Applies a member function of Type to the container itself and all consensus features....
Definition: ConsensusMap.h:337
const DataValue & getValue(const String &key) const
Returns a value of a parameter.
std::forward_iterator_tag iterator_category
Definition: MatchedIterator.h:75
Quantitation.
Definition: DataProcessing.h:72
static float allowedTol(float tol, const T &elem_ref)
Definition: MatchedIterator.h:312
void setMetaValue(const String &name, const DataValue &value)
Sets the DataValue corresponding to a name.
Unknown file extension.
Definition: FileTypes.h:60
bool operator!=(const MatchedIterator &rhs) const
Definition: MatchedIterator.h:152
void setToEnd_()
Definition: MatchedIterator.h:236
static T getDiffAbsolute(const T &elem_ref, const T &elem_tgt)
just use fabs on the value directly
Definition: MatchedIterator.h:301
MatchedIterator(const CONST_CONT_IT ref_begin, const CONST_CONT_IT ref_end, const CONST_CONT_IT tgt_begin, const CONST_CONT_IT tgt_end, float tolerance)
Constructs a MatchedIterator on two containers. The way a match is found, depends on the TRAIT type (...
Definition: MatchedIterator.h:109
#define OPENMS_PRECONDITION(condition, message)
Precondition macro.
Definition: openms/include/OpenMS/CONCEPT/Macros.h:136
void setPrimaryMSRunPath(const StringList &s)
set the file path to the primary MS run (usually the mzML file obtained after data conversion from ra...
void setLogType(LogType type) const
Sets the progress log that should be used. The default type is NONE!
std::vector< PeakType >::const_iterator const_iterator
Definition: MassTrace.h:110
A consensus feature spanning multiple LC-MS/MS experiments.
Definition: ConsensusFeature.h:69
size_t tgtIdx() const
index into target container
Definition: MatchedIterator.h:194
void insert(const ConsensusFeature &cf)
Adds all feature handles (of the CF) into the consensus feature.
Extracts chromatographic peaks from a mass trace.
Definition: ElutionPeakDetection.h:76
CONST_CONT_IT ref_begin_
Definition: MatchedIterator.h:284
MatchedIterator operator++(int)
post-increment
Definition: MatchedIterator.h:214
A container for consensus elements.
Definition: ConsensusMap.h:79
void setRT(CoordinateType coordinate)
Mutable access to the RT coordinate (index 0)
Definition: Peak2D.h:214
CONST_CONT_IT ref_end_
Definition: MatchedIterator.h:284
std::enable_if< _CONST, pointer >::type operator->() const
pointer to current target element
Definition: MatchedIterator.h:171
void setParameters(const Param ¶m)
Sets the parameters.
void setQuality(QualityType q)
Set the overall quality.
void setValidStrings(const String &key, const std::vector< String > &strings)
Sets the valid strings for the parameter key.
std::enable_if< !_CONST, pointer >::type operator->()
Definition: MatchedIterator.h:176
typename CONT_T::const_iterator CONST_CONT_IT
Definition: MatchedIterator.h:82
static float getDiffAbsolute(const T &elem_ref, const T &elem_tgt)
for Peak1D & Co
Definition: MatchedIterator.h:318
typename std::conditional< CONST_T, typename CONT_T::value_type const &, typename CONT_T::value_type & >::type reference
Definition: MatchedIterator.h:79
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:77
Definition: MatchedIterator.h:326
static float allowedTol(float tol, const T &)
Definition: MatchedIterator.h:295
void remove(const String &key)
Remove the entry key or a section key (when suffix is ':')
void setWidth(WidthType fwhm)
Set the width of the feature (FWHM)
Param copy(const String &prefix, bool remove_prefix=false) const
Returns a new Param object containing all entries that start with prefix.
static MatchedIterator end()
the end iterator
Definition: MatchedIterator.h:222
bool toBool() const
Conversion to bool.
const Param & getDefaults() const
Non-mutable access to the default parameters.
static float getDiffAbsolute(const T &elem_ref, const T &elem_tgt)
for Peak1D & Co
Definition: MatchedIterator.h:335
Size applyMemberFunction(Size(Type::*member_function)())
Applies a member function of Type to the container itself and all features (including subordinates)....
Definition: FeatureMap.h:280
A mass trace extraction method that gathers peaks similar in m/z and moving along retention time.
Definition: MassTraceDetection.h:72
Type
Actual file types enum.
Definition: FileTypes.h:58
void load(const String &filename, PeakMap &map)
Loads a map from a MzML file. Spectra and chromatograms are sorted by default (this can be disabled u...
MatchedIterator(const CONT_T &ref, const CONT_T &target, float tolerance)
Constructs a MatchedIterator on two containers. The way a match is found, depends on the TRAIT type (...
Definition: MatchedIterator.h:93
void filterByPeakWidth(std::vector< MassTrace > &, std::vector< MassTrace > &)
Filter out mass traces below lower 5 % quartile and above upper 95 % quartile.
File adapter for MzML files.
Definition: MzMLFile.h:55
bool isEnd_() const
Definition: MatchedIterator.h:241
void sortSpectra(bool sort_mz=true)
Sorts the data points by retention time.
void setCharge(const ChargeType &ch)
Set charge state.
Trait for MatchedIterator to find pairs with a certain distance, which is computed directly on the va...
Definition: MatchedIterator.h:292
static double sd(IteratorType begin, IteratorType end, double mean=std::numeric_limits< double >::max())
Calculates the standard deviation of a range of values.
Definition: StatisticFunctions.h:305
A more convenient string class.
Definition: String.h:58
Representation of a Peak2D, RichPeak2D or Feature .
Definition: FeatureHandle.h:57
void advanceTarget_()
Definition: MatchedIterator.h:246
std::ptrdiff_t difference_type
Definition: MatchedIterator.h:77
std::enable_if< !_CONST, reference >::type operator*()
Definition: MatchedIterator.h:164
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
#define OPENMS_LOG_WARN
Macro if a warning, a piece of information which should be read by the user, should be logged.
Definition: LogStream.h:460
T ppmToMass(T ppm, T mz_ref)
Compute the mass diff in [Th], given a ppm value and a reference point.
Definition: MathFunctions.h:263
bool is_end_
Definition: MatchedIterator.h:288
const value_type & ref() const
current element in reference container
Definition: MatchedIterator.h:182
typename std::conditional< CONST_T, typename CONT_T::value_type const *, typename CONT_T::value_type * >::type pointer
Definition: MatchedIterator.h:78
Facilitates file handling by file type recognition.
Definition: FileHandler.h:62
static String basename(const String &file)
Returns the basename of the file (without the path).
CONST_CONT_IT tgt_end_
Definition: MatchedIterator.h:285
MatchedIterator()
Default CTor; do not use this for anything other than assigning to it;.
Definition: MatchedIterator.h:125
static Type nameToType(const String &name)
Converts a file type name into a Type.
MatchedIterator(bool)
Definition: MatchedIterator.h:231
int main(int argc, const char **argv)
Definition: INIFileEditor.cpp:73
PeakFileOptions & getOptions()
Mutable access to the options for loading/storing.
float tol_
Definition: MatchedIterator.h:287