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