 |
OpenMS
2.4.0
|
Go to the documentation of this file.
39 #include <boost/math/special_functions/gamma.hpp>
67 return (ceil(x / pow(10.0, decPow))) * pow(10.0, decPow);
83 return (floor(0.5 + x / pow(10.0, decPow))) * pow(10.0, decPow);
85 return -((floor(0.5 + fabs(x) / pow(10.0, decPow))) * pow(10.0, decPow));
95 return left2 + (x - left1) * (right2 - left2) / (right1 - left1);
119 return pow(10, x) - 1;
137 template <
typename T>
142 return T(floor(x + T(0.5)));
146 return T(ceil(x - T(0.5)));
157 return std::fabs(a - b) <= tol;
168 template <
typename T>
193 template <
typename T>
194 T
gcd(T a, T b, T & u1, T & u2)
232 template <
typename T>
235 return (mz_obs - mz_ref) / mz_ref * 1e6;
247 template <
typename T>
250 return std::fabs(
getPPM(mz_obs, mz_ref));
262 template <
typename T>
265 return (ppm / 1e6) * mz_ref;
277 template <
typename T>
280 return std::fabs(
ppmToMass(ppm, mz_ref));
296 inline static std::pair<double, double>
getTolWindow(
double val,
double tol,
bool ppm)
302 left = val - val * tol * 1e-6;
303 right = val / (1.0 - tol * 1e-6);
311 return std::make_pair(left, right);
324 return lgamma(
double(x+1));
Base class for TOPP applications.
Definition: TOPPBase.h:150
Size applyMemberFunction(Size(Type::*member_function)())
Applies a member function of Type to the container itself and all consensus features....
Definition: ConsensusMap.h:296
void run(const PeakMap &, std::vector< MassTrace > &)
Main method of MassTraceDetection. Extracts mass traces of a MSExperiment and gathers them into a vec...
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.
std::vector< PeakType >::const_iterator const_iterator
Definition: MassTrace.h:109
static bool approximatelyEqual(double a, double b, double tol)
Returns if a is approximately equal b , allowing a tolerance of tol.
Definition: MathFunctions.h:155
const std::vector< ConvexHull2D > & getConvexHulls() const
Non-mutable access to the convex hulls.
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.
bool isOdd(UInt x)
Returns true if the given integer is odd.
Definition: MathFunctions.h:127
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:57
void setValidStrings(const String &key, const std::vector< String > &strings)
Sets the valid strings for the parameter key.
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:77
OpenMS consensus map format (.consensusXML)
Definition: FileTypes.h:67
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
#define LOG_INFO
Macro if a information, e.g. a status should be reported.
Definition: LogStream.h:454
const DataValue & getValue(const String &key) const
Returns a value of a parameter.
void setPrimaryMSRunPath(const StringList &s)
set the file path to the primary MS run (usually the mzML file obtained after data conversion from ra...
static std::pair< double, double > getTolWindow(double val, double tol, bool ppm)
Return tolerance window around val given tolerance tol.
Definition: MathFunctions.h:296
Unknown file extension.
Definition: FileTypes.h:60
void setIntensity(IntensityType intensity)
Non-mutable access to the data point intensity (height)
Definition: Peak2D.h:172
Size size() const
Definition: MSExperiment.h:127
T getPPMAbs(T mz_obs, T mz_ref)
Compute absolute parts-per-million of two m/z values.
Definition: MathFunctions.h:248
double log2linear(double x)
Transforms a number from log10 to to linear scale. Subtracts the 1 added by linear2log(double)
Definition: MathFunctions.h:117
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.
Extracts chromatographic peaks from a mass trace.
Definition: ElutionPeakDetection.h:76
T ppmToMassAbs(T ppm, T mz_ref)
Definition: MathFunctions.h:278
#define LOG_WARN
Macro if a warning, a piece of information which should be read by the user, should be logged.
Definition: LogStream.h:450
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...
Facilitates file handling by file type recognition.
Definition: FileHandler.h:62
Type
Actual file types enum.
Definition: FileTypes.h:58
static double intervalTransformation(double x, double left1, double right1, double left2, double right2)
transforms point x of interval [left1,right1] into interval [left2,right2]
Definition: MathFunctions.h:93
T getPPM(T mz_obs, T mz_ref)
Compute parts-per-million of two m/z values.
Definition: MathFunctions.h:233
A consensus feature spanning multiple LC-MS/MS experiments.
Definition: ConsensusFeature.h:69
Size setUniqueId()
Assigns a new, valid unique id. Always returns 1.
Definition: UniqueIdInterface.h:150
T round(T x)
Rounds the value.
Definition: MathFunctions.h:138
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.
T gcd(T a, T b)
Returns the greatest common divisor (gcd) of two numbers by applying the Euclidean algorithm.
Definition: MathFunctions.h:169
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:274
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.
static double ceilDecimal(double x, int decPow)
rounds x up to the next decimal power 10 ^ decPow
Definition: MathFunctions.h:65
A container for consensus elements.
Definition: ConsensusMap.h:75
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:73
void store(const String &filename, const FeatureMap &feature_map)
stores the map feature_map in file with name filename.
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
int main(int argc, const char **argv)
Definition: INIFileEditor.cpp:73
A container for features.
Definition: FeatureMap.h:93
void remove(const String &key)
Remove the entry key or a section key (when suffix is ':')
An LC-MS feature.
Definition: Feature.h:70
Representation of a Peak2D, RichPeak2D or Feature .
Definition: FeatureHandle.h:57
double linear2log(double x)
Transforms a number from linear to log10 scale. Avoids negative logarithms by adding 1.
Definition: MathFunctions.h:105
This class provides Input/Output functionality for feature maps.
Definition: FeatureXMLFile.h:68
void getPrimaryMSRunPath(StringList &toFill) const
get the file path to the first MS run
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.
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:74
CoordinateType getMZ() const
Returns the m/z coordinate (index 1)
Definition: Peak2D.h:196
static double roundDecimal(double x, int decPow)
rounds x to the next decimal power 10 ^ decPow
Definition: MathFunctions.h:80
void insert(const String &prefix, const Param ¶m)
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)
double factLn(UInt x)
Return the ln(x!) of a value.
Definition: MathFunctions.h:322
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:61
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:306