OpenMS  2.5.0
EuclideanSimilarity.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2020.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Mathias Walzer $
32 // $Authors: $
33 // --------------------------------------------------------------------------
34 //
35 #pragma once
36 
37 #include <cmath>
39 
40 namespace OpenMS
41 {
42 
51  class OPENMS_DLLAPI EuclideanSimilarity
52  {
53 private:
54 
55  float scale_;
56 
57 public:
58 
61 
64 
66  virtual ~EuclideanSimilarity();
67 
69  EuclideanSimilarity & operator=(const EuclideanSimilarity & source);
70 
71 
80  float operator()(const std::pair<float, float> & a, const std::pair<float, float> & b) const;
81 
88  float operator()(const std::pair<float, float> & c) const;
89 
98  void setScale(float x);
99 
100  };
101 
102 }
ConsensusXMLFile.h
OpenMS::TOPPBase
Base class for TOPP applications.
Definition: TOPPBase.h:144
OpenMS::Param::copy
Param copy(const String &prefix, bool remove_prefix=false) const
Returns a new Param object containing all entries that start with prefix.
OpenMS::PeptideProteinResolution
Resolves shared peptides based on protein scores.
Definition: PeptideProteinResolution.h:86
OpenMS::FeatureFinderAlgorithmIsotopeWavelet
Implements the isotope wavelet feature finder.
Definition: FeatureFinderAlgorithmIsotopeWavelet.h:59
OpenMS::BayesianProteinInferenceAlgorithm
Performs a Bayesian protein inference on Protein/Peptide identifications or ConsensusMap (experimenta...
Definition: BayesianProteinInferenceAlgorithm.h:75
double
OpenMS::ConsensusXMLFile::store
void store(const String &filename, const ConsensusMap &consensus_map)
Stores a consensus map to file.
OpenMS::StopWatch::stop
bool stop()
OpenMS::IdXMLFile::store
void store(const String &filename, const std::vector< ProteinIdentification > &protein_ids, const std::vector< PeptideIdentification > &peptide_ids, const String &document_id="")
Stores the data in an idXML file.
ExperimentalDesignFile.h
StopWatch.h
IDMergerAlgorithm.h
OpenMS::MSExperiment::sortSpectra
void sortSpectra(bool sort_mz=true)
Sorts the data points by retention time.
OpenMS::MzMLFile::store
void store(const String &filename, const PeakMap &map) const
Stores a map in an MzML file.
OpenMS::Peak1D::setMZ
void setMZ(CoordinateType mz)
Mutable access to m/z.
Definition: Peak1D.h:121
OpenMS::EuclideanSimilarity::scale_
float scale_
Definition: EuclideanSimilarity.h:55
OpenMS::Param::setValue
void setValue(const String &key, const DataValue &value, const String &description="", const StringList &tags=StringList())
Sets a value.
OpenMS::MzMLFile
File adapter for MzML files.
Definition: MzMLFile.h:55
OpenMS::String
A more convenient string class.
Definition: String.h:58
OpenMS::ProteinIdentification::ProteinGroup::accessions
std::vector< String > accessions
Accessions of (indistinguishable) proteins that belong to the same group.
Definition: ProteinIdentification.h:98
OpenMS::MSExperiment::begin
Iterator begin()
Definition: MSExperiment.h:157
OpenMS::String::trim
String & trim()
removes whitespaces (space, tab, line feed, carriage return) at the beginning and the end of the stri...
MzMLFile.h
OpenMS::MSExperiment
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:77
OpenMS::Size
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
IdXMLFile.h
FeatureXMLFile.h
OpenMS::Constants::c
const double c
OpenMS::IDFilter::updateProteinGroups
static bool updateProteinGroups(std::vector< ProteinIdentification::ProteinGroup > &groups, const std::vector< ProteinHit > &hits)
Update protein groups after protein hits were filtered.
StatisticFunctions.h
OpenMS::Peak2D::getIntensity
IntensityType getIntensity() const
Definition: Peak2D.h:166
OpenMS::Peak1D::setIntensity
void setIntensity(IntensityType intensity)
Mutable access to the data point intensity (height)
Definition: Peak1D.h:112
OpenMS::FeatureMap::setPrimaryMSRunPath
void setPrimaryMSRunPath(const StringList &s)
set the file path to the primary MS run (usually the mzML file obtained after data conversion from ra...
Constants.h
OpenMS::IDMergerAlgorithm
Creates a new Protein ID run into which other runs can be inserted. Creates union of protein hits but...
Definition: IDMergerAlgorithm.h:61
OpenMS::IdXMLFile::load
void load(const String &filename, std::vector< ProteinIdentification > &protein_ids, std::vector< PeptideIdentification > &peptide_ids)
Loads the identifications of an idXML file without identifier.
OpenMS::Exception::InvalidParameter
Exception indicating that an invalid parameter was handed over to an algorithm.
Definition: Exception.h:347
OpenMS::IDFilter::removeUnreferencedProteins
static void removeUnreferencedProteins(std::vector< ProteinIdentification > &proteins, const std::vector< PeptideIdentification > &peptides)
Removes protein hits from proteins that are not referenced by a peptide in peptides.
OpenMS::Peak2D::setRT
void setRT(CoordinateType coordinate)
Mutable access to the RT coordinate (index 0)
Definition: Peak2D.h:214
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
OpenMS::MSExperiment::addSpectrum
void addSpectrum(const MSSpectrum &spectrum)
adds a spectrum to the list
Exception.h
OpenMS::MzMLFile::load
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...
OpenMS::StopWatch::reset
void reset()
int
FeatureFinderAlgorithmIsotopeWavelet.h
OpenMS::ConsensusFeature
A consensus feature spanning multiple LC-MS/MS experiments.
Definition: ConsensusFeature.h:69
OpenMS::FeatureFinder
The main feature finder class.
Definition: FeatureFinder.h:56
OpenMS::String::split
bool split(const char splitter, std::vector< String > &substrings, bool quote_protect=false) const
Splits a string into substrings using splitter as delimiter.
OpenMS::Peak2D::setMZ
void setMZ(CoordinateType coordinate)
Mutable access to the m/z coordinate (index 1)
Definition: Peak2D.h:202
OpenMS::DefaultParamHandler::setParameters
void setParameters(const Param &param)
Sets the parameters.
OpenMS::DefaultParamHandler::getParameters
const Param & getParameters() const
Non-mutable access to the parameters.
OpenMS::PeptideProteinResolution::resolveGraph
void resolveGraph(ProteinIdentification &protein, std::vector< PeptideIdentification > &peptides)
OpenMS::StopWatch::toString
String toString() const
get a compact representation of the current time status.
OpenMS::EuclideanSimilarity
CompareFunctor for 2Dpoints.
Definition: EuclideanSimilarity.h:51
OpenMS::Peak1D
A 1-dimensional raw data point or peak.
Definition: Peak1D.h:54
OpenMS::ConsensusMap
A container for consensus elements.
Definition: ConsensusMap.h:79
OpenMS::StringList
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:70
OpenMS::FeatureXMLFile::store
void store(const String &filename, const FeatureMap &feature_map)
stores the map feature_map in file with name filename.
OpenMS::Peak2D::getRT
CoordinateType getRT() const
Returns the RT coordinate (index 0)
Definition: Peak2D.h:208
OpenMS::StopWatch
StopWatch Class.
Definition: StopWatch.h:59
OpenMS::FalseDiscoveryRate
Calculates false discovery rates (FDR) from identifications.
Definition: FalseDiscoveryRate.h:77
main
int main(int argc, const char **argv)
Definition: INIFileEditor.cpp:73
ExperimentalDesign.h
OpenMS::PeptideProteinResolution::buildGraph
void buildGraph(ProteinIdentification &protein, const std::vector< PeptideIdentification > &peptides, bool skip_sort=false)
OpenMS::StopWatch::start
bool start()
OpenMS::ConsensusMap::getColumnHeaders
const ColumnHeaders & getColumnHeaders() const
Non-mutable access to the file descriptions.
OpenMS::FeatureMap
A container for features.
Definition: FeatureMap.h:95
OpenMS::Feature
An LC-MS feature.
Definition: Feature.h:70
OpenMS::MSExperiment::end
Iterator end()
Definition: MSExperiment.h:167
OpenMS::FeatureXMLFile
This class provides Input/Output functionality for feature maps.
Definition: FeatureXMLFile.h:68
OpenMS::MSExperiment::updateRanges
void updateRanges() override
Updates minimum and maximum position/intensity.
OpenMS::Param
Management and storage of parameters / INI files.
Definition: Param.h:73
OpenMS::FalseDiscoveryRate::applyBasic
void applyBasic(std::vector< PeptideIdentification > &ids)
simpler reimplemetation of the apply function above.
OpenMS::ProgressLogger::NONE
No progress logging.
Definition: ProgressLogger.h:74
IDFilter.h
OpenMS::MSExperiment::ConstIterator
std::vector< SpectrumType >::const_iterator ConstIterator
Non-mutable iterator.
Definition: MSExperiment.h:113
OpenMS::Map
Map class based on the STL map (containing several convenience functions)
Definition: Map.h:50
OpenMS::Peak2D::getMZ
CoordinateType getMZ() const
Returns the m/z coordinate (index 1)
Definition: Peak2D.h:196
OPENMS_LOG_INFO
#define OPENMS_LOG_INFO
Macro if a information, e.g. a status should be reported.
Definition: LogStream.h:465
OpenMS::Constants::NEUTRON_MASS_U
const double NEUTRON_MASS_U
OpenMS::FeatureFinder::run
void run(const String &algorithm_name, PeakMap &input_map, FeatureMap &features, const Param &param, const FeatureMap &seeds)
Executes the FeatureFinder using the given algorithm.
OpenMS::MSSpectrum::ConstIterator
ContainerType::const_iterator ConstIterator
Non-mutable iterator.
Definition: MSSpectrum.h:104
BayesianProteinInferenceAlgorithm.h
OpenMS::MSSpectrum
The representation of a 1D spectrum.
Definition: MSSpectrum.h:67
OpenMS::MSSpectrum::setRT
void setRT(double rt)
Sets the absolute retention time (in seconds)
FalseDiscoveryRate.h
StandardTypes.h
File.h
PeptideProteinResolution.h
OpenMS::ProgressLogger::setLogType
void setLogType(LogType type) const
Sets the progress log that should be used. The default type is NONE!
TOPPBase.h
OpenMS::ConsensusMap::setPrimaryMSRunPath
void setPrimaryMSRunPath(const StringList &s)
set the file paths to the primary MS run (stored in ColumnHeaders)
OpenMS::Math::absdev
static double absdev(IteratorType begin, IteratorType end, double mean=std::numeric_limits< double >::max())
Calculates the absolute deviation of a range of values.
Definition: StatisticFunctions.h:320
OpenMS::ConsensusFeature::insert
void insert(const ConsensusFeature &cf)
Adds all feature handles (of the CF) into the consensus feature.
OpenMS::ConsensusXMLFile
This class provides Input functionality for ConsensusMaps and Output functionality for alignments and...
Definition: ConsensusXMLFile.h:61
OpenMS::IdXMLFile
Used to load and store idXML files.
Definition: IdXMLFile.h:63
OpenMS::String::toLower
String & toLower()
Converts the string to lowercase.
OpenMS::ProteinIdentification::ProteinGroup
Bundles multiple (e.g. indistinguishable) proteins in a group.
Definition: ProteinIdentification.h:81