OpenMS  3.0.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-2022.
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 }
IDScoreSwitcherAlgorithm.h
OpenMS::StringUtils::split
static bool split(const String &this_s, const char splitter, std::vector< String > &substrings, bool quote_protect)
Definition: StringUtilsSimple.h:360
ConsensusXMLFile.h
OpenMS::TOPPBase
Base class for TOPP applications.
Definition: TOPPBase.h:147
OpenMS::ExperimentalDesignFile::load
static ExperimentalDesign load(const String &tsv_file, bool require_spectra_files)
Loads an experimental design from a tabular separated file.
FileHandler.h
FileTypes.h
OpenMS::FeatureFinderAlgorithmIsotopeWavelet
Implements the isotope wavelet feature finder.
Definition: FeatureFinderAlgorithmIsotopeWavelet.h:59
Size
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::Param::setValue
void setValue(const std::string &key, const ParamValue &value, const std::string &description="", const std::vector< std::string > &tags=std::vector< std::string >())
Sets a value.
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::FileHandler::getTypeByFileName
static FileTypes::Type getTypeByFileName(const String &filename)
Determines the file type from a file name.
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:119
OpenMS::EuclideanSimilarity::scale_
float scale_
Definition: EuclideanSimilarity.h:55
OpenMS::FalseDiscoveryRate::applyPickedProteinFDR
void applyPickedProteinFDR(ProteinIdentification &id, String decoy_string="", bool prefix=true, bool groups_too=true)
Applies a picked protein FDR. Behaves like a normal target-decoy FDR where only the score of the best...
OpenMS::MzMLFile
File adapter for MzML files.
Definition: MzMLFile.h:57
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:134
OpenMS::MSExperiment::begin
Iterator begin()
Definition: MSExperiment.h:150
OpenMS::String::trim
String & trim()
removes whitespaces (space, tab, line feed, carriage return) at the beginning and the end of the stri...
MzMLFile.h
Int
OpenMS::MSExperiment
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:70
OpenMS::FileTypes::CONSENSUSXML
OpenMS consensus map format (.consensusXML)
Definition: FileTypes.h:65
IdXMLFile.h
FeatureXMLFile.h
OpenMS::ProteinHit
Representation of a protein hit.
Definition: ProteinHit.h:58
OpenMS::Constants::c
const double c
Definition: Constants.h:209
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:110
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...
OpenMS::IDScoreSwitcherAlgorithm::switchToGeneralScoreType
void switchToGeneralScoreType(std::vector< PeptideIdentification > &id, ScoreType type, Size &counter)
Definition: IDScoreSwitcherAlgorithm.h:119
OpenMS::ConsensusMapMergerAlgorithm::mergeAllIDRuns
void mergeAllIDRuns(ConsensusMap &cmap) const
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
ConsensusMapMergerAlgorithm.h
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:339
OPENMS_LOG_FATAL_ERROR
#define OPENMS_LOG_FATAL_ERROR
Macro to be used if fatal error are reported (processing stops)
Definition: LogStream.h:450
OpenMS::ConsensusMapMergerAlgorithm::mergeProteinsAcrossFractionsAndReplicates
void mergeProteinsAcrossFractionsAndReplicates(ConsensusMap &cmap, const ExperimentalDesign &exp_design) const
OpenMS::Peak2D::setRT
void setRT(CoordinateType coordinate)
Mutable access to the RT coordinate (index 0)
Definition: Peak2D.h:214
OpenMS::ProteinHit::getAccession
const String & getAccession() const
returns the accession of the protein
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
OpenMS::MSExperiment::addSpectrum
void addSpectrum(const MSSpectrum &spectrum)
adds a spectrum to the list
Exception.h
OpenMS::IDFilter::removeUnreferencedProteins
static void removeUnreferencedProteins(ConsensusMap &cmap, bool include_unassigned)
OpenMS::ConsensusMapMergerAlgorithm
Merges identification data in ConsensusMaps.
Definition: ConsensusMapMergerAlgorithm.h:63
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()
Clear the stop watch but keep running.
OpenMS::ConsensusMap::getProteinIdentifications
const std::vector< ProteinIdentification > & getProteinIdentifications() const
non-mutable access to the protein identifications
FeatureFinderAlgorithmIsotopeWavelet.h
OpenMS::FalseDiscoveryRate::applyBasic
void applyBasic(const std::vector< ProteinIdentification > &run_info, std::vector< PeptideIdentification > &ids)
simpler reimplementation of the apply function above for PSMs. With charge and identifier info from r...
OpenMS::FileTypes::Type
Type
Actual file types enum.
Definition: FileTypes.h:56
OpenMS::ConsensusFeature
A consensus feature spanning multiple LC-MS/MS experiments.
Definition: ConsensusFeature.h:69
OpenMS::StopWatch::start
void start()
Start the stop watch.
OpenMS::FeatureFinder
The main feature finder class.
Definition: FeatureFinder.h:56
OpenMS::FileHandler::getType
static FileTypes::Type getType(const String &filename)
Tries to determine the file type (by name or content)
OpenMS::IDScoreSwitcherAlgorithm
Definition: IDScoreSwitcherAlgorithm.h:48
OpenMS::Peak2D::setMZ
void setMZ(CoordinateType coordinate)
Mutable access to the m/z coordinate (index 1)
Definition: Peak2D.h:202
OpenMS::StopWatch::stop
void stop()
Stop the stop watch (can be resumed later). If the stop watch was not running an exception is thrown.
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::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:53
OpenMS::ConsensusMap
A container for consensus elements.
Definition: ConsensusMap.h:82
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::ConsensusXMLFile::load
void load(const String &filename, ConsensusMap &map)
Loads a consensus map from file and calls updateRanges.
OpenMS::StopWatch
This class is used to determine the current process' CPU (user and/or kernel) and wall time.
Definition: StopWatch.h:65
OpenMS::FalseDiscoveryRate
Calculates false discovery rates (FDR) from identifications.
Definition: FalseDiscoveryRate.h:77
main
int main(int argc, const char **argv)
Definition: INIFileEditor.cpp:71
ExperimentalDesign.h
OpenMS::ConsensusMap::getColumnHeaders
const ColumnHeaders & getColumnHeaders() const
Non-mutable access to the file descriptions.
OPENMS_LOG_ERROR
#define OPENMS_LOG_ERROR
Macro to be used if non-fatal error are reported (processing continues)
Definition: LogStream.h:455
OpenMS::FeatureMap
A container for features.
Definition: FeatureMap.h:98
OpenMS::IDScoreSwitcherAlgorithm::ScoreType::PEP
OpenMS::Feature
An LC-MS feature.
Definition: Feature.h:70
OpenMS::Param::copy
Param copy(const std::string &prefix, bool remove_prefix=false) const
Returns a new Param object containing all entries that start with prefix.
OpenMS::MSExperiment::end
Iterator end()
Definition: MSExperiment.h:160
OpenMS::FeatureXMLFile
This class provides Input/Output functionality for feature maps.
Definition: FeatureXMLFile.h:62
OpenMS::FileTypes::nameToType
static Type nameToType(const String &name)
OpenMS::MSExperiment::updateRanges
void updateRanges() override
OpenMS::Param
Management and storage of parameters / INI files.
Definition: Param.h:69
OpenMS::ProgressLogger::NONE
No progress logging.
Definition: ProgressLogger.h:72
IDFilter.h
OpenMS::MSExperiment::ConstIterator
std::vector< SpectrumType >::const_iterator ConstIterator
Non-mutable iterator.
Definition: MSExperiment.h:106
OpenMS::Exception::MissingInformation
Not all required information provided.
Definition: Exception.h:186
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
Definition: Constants.h:131
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:130
BayesianProteinInferenceAlgorithm.h
OpenMS::MSSpectrum
The representation of a 1D spectrum.
Definition: MSSpectrum.h:66
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:336
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:58
OpenMS::IdXMLFile
Used to load and store idXML files.
Definition: IdXMLFile.h:68
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:117