OpenMS  3.0.0
FeatureFinderMultiplexAlgorithm.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: Lars Nilse $
32 // $Authors: Lars Nilse $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
42 
48 
49 #include <vector>
50 #include <fstream>
51 #include <map>
52 
53 namespace OpenMS
54 {
55 
56 class OPENMS_DLLAPI FeatureFinderMultiplexAlgorithm :
57  public DefaultParamHandler, public ProgressLogger
58 {
59 public:
62 
64  void run(MSExperiment& exp, bool progress);
65 
67  FeatureMap& getFeatureMap();
68  ConsensusMap& getConsensusMap();
69  MSExperiment& getBlacklist();
70 
71 protected:
72 
73  // experimental data
76 
78 
80 
81  bool progress_;
82 
83  unsigned charge_min_;
84  unsigned charge_max_;
85 
88 
89 
90  // mass shift names and their values
91  std::map<String, double> label_mass_shift_;
92 
93  // final results, maps of detected features
96 
97  // blacklist
99 
110  std::vector<MultiplexIsotopicPeakPattern> generatePeakPatterns_(int charge_min, int charge_max, int peaks_per_peptide_max, const std::vector<MultiplexDeltaMasses>& mass_pattern_list);
111 
121  void correctPeptideIntensities_(const MultiplexIsotopicPeakPattern& pattern, std::map<size_t, SplinePackage>& spline_chromatograms, const std::vector<double>& rt_peptide, std::vector<double>& intensity_peptide) const;
122 
131  std::vector<double> determinePeptideIntensitiesCentroided_(const MultiplexIsotopicPeakPattern& pattern, const std::multimap<size_t, MultiplexSatelliteCentroided >& satellites);
132 
141  std::vector<double> determinePeptideIntensitiesProfile_(const MultiplexIsotopicPeakPattern& pattern, const std::multimap<size_t, MultiplexSatelliteProfile >& satellites);
142 
150  void generateMapsCentroided_(const std::vector<MultiplexIsotopicPeakPattern>& patterns, const std::vector<MultiplexFilteredMSExperiment>& filter_results, std::vector<std::map<int, GridBasedCluster> >& cluster_results);
151 
159  void generateMapsProfile_(const std::vector<MultiplexIsotopicPeakPattern>& patterns, const std::vector<MultiplexFilteredMSExperiment>& filter_results, const std::vector<std::map<int, GridBasedCluster> >& cluster_results);
160 
161 };
162 
163 }
OpenMS::FeatureFinderAlgorithmMetaboIdent::getNShared
size_t getNShared() const
Retrieve number of features with shared identifications.
Definition: FeatureFinderAlgorithmMetaboIdent.h:115
LogStream.h
DefaultParamHandler.h
GaussTraceFitter.h
ElutionModelFitter.h
ConsensusXMLFile.h
SplinePackage.h
OpenMS::TOPPBase
Base class for TOPP applications.
Definition: TOPPBase.h:147
OpenMS::FeatureFinderMultiplexAlgorithm::consensus_map_
ConsensusMap consensus_map_
Definition: FeatureFinderMultiplexAlgorithm.h:95
TargetedExperiment.h
FeatureFindingMetabo.h
OpenMS::TraMLFile::store
void store(const String &filename, const TargetedExperiment &id) const
Stores a map in a TraML file.
OpenMS::MassTraceDetection
A mass trace extraction method that gathers peaks similar in m/z and moving along retention time.
Definition: MassTraceDetection.h:72
Size
OMSFileLoad.h
OpenMS::FeatureFinderMultiplexAlgorithm::run
void run(MSExperiment &exp, bool progress)
main method for feature detection
MultiplexClustering.h
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::Exception::IllegalArgument
A method or algorithm argument contains illegal values.
Definition: Exception.h:648
DPosition.h
OpenMS::FeatureFinderAlgorithmMetaboIdent::prettyPrintCompound
String prettyPrintCompound(const TargetedExperiment::Compound &compound)
OpenMS::FeatureFinderMultiplexAlgorithm::centroided_
bool centroided_
Definition: FeatureFinderMultiplexAlgorithm.h:77
OpenMS::Param::insert
void insert(const std::string &prefix, const Param &param)
OpenMS::FeatureFinder::getParameters
Param getParameters(const String &algorithm_name) const
Returns the default parameters for the algorithm with name algorithm_name.
OpenMS::File::basename
static String basename(const String &file)
OpenMS::MSExperiment::sortSpectra
void sortSpectra(bool sort_mz=true)
Sorts the data points by retention time.
OpenMS::String::substitute
String & substitute(char from, char to)
Replaces all occurrences of the character from by the character to.
OpenMS::MzMLFile::store
void store(const String &filename, const PeakMap &map) const
Stores a map in an MzML file.
MultiplexSatelliteCentroided.h
OpenMS::MzMLFile
File adapter for MzML files.
Definition: MzMLFile.h:57
OpenMS::FeatureFinderMultiplexAlgorithm::prog_log_
ProgressLogger prog_log_
Definition: FeatureFinderMultiplexAlgorithm.h:79
OpenMS::String
A more convenient string class.
Definition: String.h:58
OpenMS::MSExperiment::begin
Iterator begin()
Definition: MSExperiment.h:150
DBoundingBox.h
MzMLFile.h
ConsensusMap.h
OpenMS::FeatureFindingMetabo
Method for the assembly of mass traces belonging to the same isotope pattern, i.e....
Definition: FeatureFindingMetabo.h:181
OpenMS::MSExperiment
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:70
OpenMS::MultiplexIsotopicPeakPattern
data structure for pattern of isotopic peaks
Definition: MultiplexIsotopicPeakPattern.h:54
SimpleOpenMSSpectraAccessFactory.h
OpenMS::PeakFileOptions::addMSLevel
void addMSLevel(int level)
adds a desired MS level for peaks to load
OpenMS::Size
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
FeatureXMLFile.h
OpenMS::FeatureFinderMultiplexAlgorithm::progress_
bool progress_
Definition: FeatureFinderMultiplexAlgorithm.h:81
OpenMS::FeatureFinderAlgorithmMetaboIdent
Definition: FeatureFinderAlgorithmMetaboIdent.h:53
OpenMS::FeatureFinderAlgorithmIsotopeWavelet::getProductName
static const String getProductName()
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...
ChromatogramExtractor.h
FeatureFinderAlgorithmPickedHelperStructs.h
OPENMS_PRECONDITION
#define OPENMS_PRECONDITION(condition, message)
Precondition macro.
Definition: openms/include/OpenMS/CONCEPT/Macros.h:120
OpenMS::FeatureFinderMultiplexAlgorithm::getFeatureMap
FeatureMap & getFeatureMap()
get methods
OPENMS_LOG_WARN
#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
OpenMS::ParamValue::toBool
bool toBool() const
Conversion to bool.
OpenMS::SpectrumSettings::PROFILE
profile data
Definition: SpectrumSettings.h:74
Constants.h
MultiplexDeltaMassesGenerator.h
ListUtils.h
OpenMS::MSExperiment::size
Size size() const
Definition: MSExperiment.h:120
OpenMS::DefaultParamHandler
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:92
OpenMS::FeatureFinderMultiplexAlgorithm::label_mass_shift_
std::map< String, double > label_mass_shift_
Definition: FeatureFinderMultiplexAlgorithm.h:91
OpenMS::StringUtils::hasPrefix
static bool hasPrefix(const String &this_s, const String &string)
Definition: StringUtilsSimple.h:111
OpenMS::ListUtils::concatenate
static String concatenate(const std::vector< T > &container, const String &glue="")
Concatenates all elements of the container and puts the glue string between elements.
Definition: ListUtils.h:209
OpenMS::FeatureFinderMultiplexAlgorithm::exp_blacklist_
MSExperiment exp_blacklist_
Definition: FeatureFinderMultiplexAlgorithm.h:98
OpenMS::FeatureFinderAlgorithmMetaboIdent::FeatureFinderMetaboIdentCompound
represents a compound in the assay library
Definition: FeatureFinderAlgorithmMetaboIdent.h:58
FeatureFinder.h
MassTrace.h
LinearRegression.h
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
FeatureFinderAlgorithmMRM.h
OpenMS::TraMLFile
File adapter for HUPO PSI TraML files.
Definition: TraMLFile.h:63
OpenMS::TargetedExperiment::getCompoundByRef
const Compound & getCompoundByRef(const String &ref) const
OpenMS::IonSource::NamesOfPolarity
static const std::string NamesOfPolarity[SIZE_OF_POLARITY]
Names of polarity of the ion source.
Definition: IonSource.h:148
OpenMS::ElutionPeakDetection
Extracts chromatographic peaks from a mass trace.
Definition: ElutionPeakDetection.h:76
OpenMS::ProgressLogger
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:52
OpenMS::MetaInfoInterface::setMetaValue
void setMetaValue(const String &name, const DataValue &value)
Sets the DataValue corresponding to a name.
ProgressLogger.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::SpectrumSettings::SpectrumType
SpectrumType
Spectrum peak type.
Definition: SpectrumSettings.h:70
MRMFeatureFinderScoring.h
TransformationXMLFile.h
MSQuantifications.h
FeatureFinderAlgorithmIsotopeWavelet.h
CoarseIsotopePatternGenerator.h
OpenMS::FeatureFinderMultiplexAlgorithm::charge_min_
unsigned charge_min_
Definition: FeatureFinderMultiplexAlgorithm.h:83
EGHTraceFitter.h
FeatureMap.h
RangeUtils.h
MultiplexIsotopicPeakPattern.h
MathFunctions.h
OpenMS::Param::setSectionDescription
void setSectionDescription(const std::string &key, const std::string &description)
Sets a description for an existing section.
OpenMS::FeatureFinderMultiplexAlgorithm::getConsensusMap
ConsensusMap & getConsensusMap()
OpenMS::FeatureFinderMultiplexAlgorithm::charge_max_
unsigned charge_max_
Definition: FeatureFinderMultiplexAlgorithm.h:84
OPENMS_LOG_DEBUG
#define OPENMS_LOG_DEBUG
Macro for general debugging information.
Definition: LogStream.h:470
OpenMS::FeatureFinder
The main feature finder class.
Definition: FeatureFinder.h:56
OpenMS::UniqueIdInterface::setUniqueId
Size setUniqueId()
Assigns a new, valid unique id. Always returns 1.
OpenMS::DefaultParamHandler::setParameters
void setParameters(const Param &param)
Sets the parameters.
OpenMS::FeatureFinderMultiplexAlgorithm::exp_profile_
MSExperiment exp_profile_
Definition: FeatureFinderMultiplexAlgorithm.h:74
OpenMS::TargetedExperimentHelper::Compound
Represents a compound (small molecule)
Definition: TargetedExperimentHelper.h:321
GridBasedCluster.h
OpenMS::FeatureMap::applyMemberFunction
Size applyMemberFunction(Size(Type::*member_function)())
Applies a member function of Type to the container itself and all features (including subordinates)....
Definition: FeatureMap.h:289
OpenMS::DefaultParamHandler::getDefaults
const Param & getDefaults() const
Non-mutable access to the default parameters.
FeatureFinderAlgorithmMetaboIdent.h
OpenMS::DefaultParamHandler::getParameters
const Param & getParameters() const
Non-mutable access to the parameters.
OpenMS::MSExperiment::empty
bool empty() const
Definition: MSExperiment.h:130
OpenMS::ElutionPeakDetection::filterByPeakWidth
void filterByPeakWidth(std::vector< MassTrace > &, std::vector< MassTrace > &)
Filter out mass traces below lower 5 % quartile and above upper 95 % quartile.
OpenMS::FeatureFinderAlgorithmMRM::getProductName
static const String getProductName()
OpenMS::ConsensusMap
A container for consensus elements.
Definition: ConsensusMap.h:82
OpenMS::FeatureMap::getUnassignedPeptideIdentifications
const std::vector< PeptideIdentification > & getUnassignedPeptideIdentifications() const
non-mutable access to the unassigned peptide identifications
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::FeatureFinderMultiplexAlgorithm::isotopes_per_peptide_max_
unsigned isotopes_per_peptide_max_
Definition: FeatureFinderMultiplexAlgorithm.h:87
OpenMS::FeatureFinderAlgorithmMetaboIdent::getMSData
PeakMap & getMSData()
Retrieve chromatograms (empty if run was not executed)
Definition: FeatureFinderAlgorithmMetaboIdent.h:96
OpenMS::FeatureFinderAlgorithmMetaboIdent::getChromatograms
const PeakMap & getChromatograms() const
Retrieve chromatograms (empty if run was not executed)
Definition: FeatureFinderAlgorithmMetaboIdent.h:105
OpenMS::MSExperiment::addChromatogram
void addChromatogram(const MSChromatogram &chromatogram)
adds a chromatogram to the list
OpenMS::ParamValue::toString
std::string toString(bool full_precision=true) const
Convert ParamValue to string.
main
int main(int argc, const char **argv)
Definition: INIFileEditor.cpp:71
MultiplexDeltaMasses.h
MSExperiment.h
OpenMS::FeatureFinderAlgorithmMetaboIdent::getLibrary
const TargetedExperiment & getLibrary() const
Retrieve the assay library (e.g., to store as TraML, empty if run was not executed)
Definition: FeatureFinderAlgorithmMetaboIdent.h:109
OpenMS::ConsensusMap::getColumnHeaders
const ColumnHeaders & getColumnHeaders() const
Non-mutable access to the file descriptions.
OpenMS::FeatureFinderMultiplexAlgorithm::exp_centroid_
MSExperiment exp_centroid_
Definition: FeatureFinderMultiplexAlgorithm.h:75
OpenMS::TargetedExperiment::getCompounds
const std::vector< Compound > & getCompounds() const
OpenMS::StringUtils::toDouble
static double toDouble(const String &this_s)
Definition: StringUtils.h:216
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
MultiplexFilteredMSExperiment.h
OpenMS::PeptideIdentification
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:63
OpenMS::Exception::ParseError
Parse Error exception.
Definition: Exception.h:622
OpenMS::TransformationXMLFile
Used to load and store TransformationXML files.
Definition: TransformationXMLFile.h:56
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::Constants::UserParam::NUM_OF_MASSTRACES
const std::string NUM_OF_MASSTRACES
Definition: Constants.h:536
OpenMS::MSExperiment::end
Iterator end()
Definition: MSExperiment.h:160
OpenMS::FeatureFinderMultiplexAlgorithm::feature_map_
FeatureMap feature_map_
Definition: FeatureFinderMultiplexAlgorithm.h:94
OpenMS::MSExperiment::getSpectra
const std::vector< MSSpectrum > & getSpectra() const
returns the spectrum list
OpenMS::FeatureXMLFile
This class provides Input/Output functionality for feature maps.
Definition: FeatureXMLFile.h:62
OpenMS::PeakFileOptions
Options for loading files containing peak data.
Definition: PeakFileOptions.h:47
OpenMS::DataProcessing::QUANTITATION
Quantitation.
Definition: DataProcessing.h:72
OpenMS::FeatureFinderMultiplexAlgorithm
Definition: FeatureFinderMultiplexAlgorithm.h:56
OpenMS::ElutionPeakDetection::detectPeaks
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...
MzQuantMLFile.h
ElutionPeakDetection.h
OpenMS::MSExperiment::updateRanges
void updateRanges() override
OpenMS::MassTraceDetection::run
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...
OpenMS::FeatureFinderAlgorithmMetaboIdent::run
void run(const std::vector< FeatureFinderMetaboIdentCompound > &metaboIdentTable, FeatureMap &features, String spectra_file="")
perform targeted feature extraction of compounds from
OpenMS::Param
Management and storage of parameters / INI files.
Definition: Param.h:69
OpenMS::TransformationXMLFile::store
void store(String filename, const TransformationDescription &transformation)
Stores the data in an TransformationXML file.
OpenMS::MSExperiment::clear
void clear(bool clear_meta_data)
Clears all data and meta data.
FeatureFinderMultiplexAlgorithm.h
MultiplexFilteringCentroided.h
OPENMS_LOG_INFO
#define OPENMS_LOG_INFO
Macro if a information, e.g. a status should be reported.
Definition: LogStream.h:465
OpenMS::PeakFileOptions::setMSLevels
void setMSLevels(const std::vector< Int > &levels)
sets the desired MS levels for peaks to load
PeakPickerHiRes.h
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::Exception::FileEmpty
File is empty.
Definition: Exception.h:594
MassTraceDetection.h
OpenMS::DataProcessing::FILTERING
Data filtering or extraction.
Definition: DataProcessing.h:71
OpenMS::Param::getValue
const ParamValue & getValue(const std::string &key) const
Returns a value of a parameter.
TraMLFile.h
OpenMS::Exception::FileNotReadable
File not readable exception.
Definition: Exception.h:523
OpenMS::TransformationDescription
Generic description of a coordinate transformation.
Definition: TransformationDescription.h:62
OpenMS::Param::remove
void remove(const std::string &key)
Remove the entry key or a section key (when suffix is ':')
OpenMS::Param::setValidStrings
void setValidStrings(const std::string &key, const std::vector< std::string > &strings)
Sets the valid strings for the parameter key.
OpenMS::FeatureFindingMetabo::run
void run(std::vector< MassTrace > &input_mtraces, FeatureMap &output_featmap, std::vector< std::vector< OpenMS::MSChromatogram > > &output_chromatograms)
main method of FeatureFindingMetabo
StandardTypes.h
File.h
MultiplexFilteringProfile.h
OpenMS::MzMLFile::getOptions
PeakFileOptions & getOptions()
Mutable access to the options for loading/storing.
OpenMS::FeatureFinderAlgorithmMetaboIdent::getTransformations
const TransformationDescription & getTransformations() const
Retrieve deviations between provided coordinates and extracted ones (e.g., to store as TrafoXML or fo...
Definition: FeatureFinderAlgorithmMetaboIdent.h:112
OpenMS::ProgressLogger::setLogType
void setLogType(LogType type) const
Sets the progress log that should be used. The default type is NONE!
OpenMS::FeatureFinderMultiplexAlgorithm::getBlacklist
MSExperiment & getBlacklist()
TOPPBase.h
OpenMS::ConsensusMap::setPrimaryMSRunPath
void setPrimaryMSRunPath(const StringList &s)
set the file paths to the primary MS run (stored in ColumnHeaders)
MSSpectrum.h
ChromatogramTools.h
OpenMS::ConsensusXMLFile
This class provides Input functionality for ConsensusMaps and Output functionality for alignments and...
Definition: ConsensusXMLFile.h:58
OpenMS::FeatureFinderMultiplexAlgorithm::isotopes_per_peptide_min_
unsigned isotopes_per_peptide_min_
Definition: FeatureFinderMultiplexAlgorithm.h:86