OpenMS  3.0.0
Element.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: Timo Sachsenberg $
32 // $Authors: Andreas Bertsch $
33 // --------------------------------------------------------------------------
34 //
35 
36 #pragma once
37 
38 #include <OpenMS/CONCEPT/Types.h>
40 
41 #include <string>
42 
43 #define OPENMS_CHEMISTRY_ELEMENT_NAME_DEFAULT "unknown"
44 #define OPENMS_CHEMISTRY_ELEMENT_SYMBOL_DEFAULT "??"
45 #define OPENMS_CHEMISTRY_ELEMENT_WEIGHT_DEFAULT 0.0
46 #define OPENMS_CHEMISTRY_ELEMENT_ATOMICNUMBER_DEFAULT 0
47 
48 namespace OpenMS
49 {
57  class OPENMS_DLLAPI Element
58  {
59 public:
60 
61 
65  Element();
67 
69  Element(const Element & element);
70 
72  Element(const std::string & name,
73  const std::string & symbol,
74  unsigned int atomic_number,
75  double average_weight,
76  double mono_weight,
77  const IsotopeDistribution & isotopes);
78 
80  virtual ~Element();
82 
86  void setAtomicNumber(unsigned int atomic_number);
88 
90  unsigned int getAtomicNumber() const;
91 
93  void setAverageWeight(double weight);
94 
96  double getAverageWeight() const;
97 
99  void setMonoWeight(double weight);
100 
102  double getMonoWeight() const;
103 
105  void setIsotopeDistribution(const IsotopeDistribution & isotopes);
106 
108  const IsotopeDistribution & getIsotopeDistribution() const;
109 
111  void setName(const std::string & name);
112 
114  const std::string & getName() const;
115 
117  void setSymbol(const std::string & symbol);
118 
120  const std::string & getSymbol() const;
122 
126  Element & operator=(const Element & element);
129 
133  bool operator==(const Element & element) const;
135 
137  bool operator!=(const Element & element) const;
138 
140  bool operator<(const Element & element) const;
142 
144  friend OPENMS_DLLAPI std::ostream & operator<<(std::ostream & os, const Element & element);
145 
146 protected:
147 
149  std::string name_;
150 
152  std::string symbol_;
153 
155  unsigned int atomic_number_;
156 
159 
161  double mono_weight_;
162 
165  };
166 
167  OPENMS_DLLAPI std::ostream & operator<<(std::ostream &, const Element &);
168 
169 } // namespace OpenMS
170 
OpenMS::Element::name_
std::string name_
name of the element
Definition: Element.h:149
EDTAFile.h
OpenMS::TOPPBase
Base class for TOPP applications.
Definition: TOPPBase.h:147
OpenMS::TextFile::end
ConstIterator end() const
Gives access to the underlying text buffer.
OpenMS::TextFile::addLine
void addLine(const StringType &line)
Definition: TextFile.h:112
Size
ListUtilsIO.h
double
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::Internal::AreaIterator
Forward iterator for an area of peaks in an experiment.
Definition: AreaIterator.h:57
Types.h
OpenMS::Element::average_weight_
double average_weight_
average weight over all isotopes
Definition: Element.h:158
OpenMS::Element
Representation of an element.
Definition: Element.h:57
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::MSExperiment::areaEndConst
ConstAreaIterator areaEndConst() const
Returns an non-mutable invalid area iterator marking the end of an area.
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::Peak2D
A 2-dimensional raw data point or peak.
Definition: Peak2D.h:54
OpenMS::EDTAFile
File adapter for Enhanced DTA files.
Definition: EDTAFile.h:84
OpenMS::MzMLFile
File adapter for MzML files.
Definition: MzMLFile.h:57
OpenMS::String
A more convenient string class.
Definition: String.h:58
OpenMS::MSExperiment::begin
Iterator begin()
Definition: MSExperiment.h:150
KDTree::operator!=
bool operator!=(_Iterator< _Val, _Ref, _Ptr > const &, _Iterator< _Val, _Ref, _Ptr > const &)
Definition: KDTree.h:824
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::GaussFilter::filter
void filter(MSSpectrum &spectrum)
Smoothes an MSSpectrum containing profile data.
Int
OpenMS::MSExperiment
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:70
OpenMS::TextFile
This class provides some basic file handling methods for text files.
Definition: TextFile.h:46
OpenMS::ChromatogramSettings::setChromatogramType
void setChromatogramType(ChromatogramType type)
sets the chromatogram type
OpenMS::SignalToNoiseEstimator::init
virtual void init(const Container &c)
Set the start and endpoint of the raw data interval, for which signal to noise ratios will be estimat...
Definition: SignalToNoiseEstimator.h:101
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::operator<
bool operator<(const MultiplexDeltaMasses &dm1, const MultiplexDeltaMasses &dm2)
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
GaussFilter.h
OpenMS::Peak2D::setIntensity
void setIntensity(IntensityType intensity)
Sets data point intensity (height)
Definition: Peak2D.h:172
OpenMS::MSExperiment::size
Size size() const
Definition: MSExperiment.h:120
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::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::ChromatogramPeak::setIntensity
void setIntensity(IntensityType intensity)
Mutable access to the data point intensity (height)
Definition: ChromatogramPeak.h:112
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:47
OpenMS::MSExperiment::Iterator
std::vector< SpectrumType >::iterator Iterator
Mutable iterator.
Definition: MSExperiment.h:104
OpenMS::PeakPickerHiRes
This class implements a fast peak-picking algorithm best suited for high resolution MS data (FT-ICR-M...
Definition: PeakPickerHiRes.h:81
OpenMS::SignalToNoiseEstimator::getSignalToNoise
virtual double getSignalToNoise(const Size index) const
Definition: SignalToNoiseEstimator.h:109
OpenMS::Element::atomic_number_
unsigned int atomic_number_
atomic number of the element
Definition: Element.h:155
OpenMS::MSExperiment::areaBeginConst
ConstAreaIterator areaBeginConst(CoordinateType min_rt, CoordinateType max_rt, CoordinateType min_mz, CoordinateType max_mz) const
Returns a non-mutable area iterator for area.
IsotopeDistribution.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::EDTAFile::load
void load(const String &filename, ConsensusMap &consensus_map)
Loads a EDTA file into a consensusXML.
OpenMS::SignalToNoiseEstimatorMedian
Estimates the signal/noise (S/N) ratio of each data point in a scan by using the median (histogram ba...
Definition: SignalToNoiseEstimatorMedian.h:81
OpenMS::ChromatogramPeak
A 1-dimensional raw data point or peak for chromatograms.
Definition: ChromatogramPeak.h:53
OpenMS::MSExperiment::areaBegin
AreaIterator areaBegin(CoordinateType min_rt, CoordinateType max_rt, CoordinateType min_mz, CoordinateType max_mz)
Returns an area iterator for area.
OpenMS::ConsensusFeature
A consensus feature spanning multiple LC-MS/MS experiments.
Definition: ConsensusFeature.h:69
OPENMS_LOG_DEBUG
#define OPENMS_LOG_DEBUG
Macro for general debugging information.
Definition: LogStream.h:470
OpenMS::PeakPickerHiRes::pick
void pick(const MSSpectrum &input, MSSpectrum &output) const
Applies the peak-picking algorithm to a single spectrum (MSSpectrum). The resulting picked peaks are ...
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::MSExperiment::empty
bool empty() const
Definition: MSExperiment.h:130
OpenMS::Peak1D
A 1-dimensional raw data point or peak.
Definition: Peak1D.h:53
OpenMS::operator<<
std::ostream & operator<<(std::ostream &os, const AccurateMassSearchResult &amsr)
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::Peak2D::getRT
CoordinateType getRT() const
Returns the RT coordinate (index 0)
Definition: Peak2D.h:208
OpenMS::MSExperiment::areaEnd
AreaIterator areaEnd()
Returns an invalid area iterator marking the end of an area.
OpenMS::ChromatogramPeak::setMZ
void setMZ(CoordinateType rt)
Alias for setRT()
Definition: ChromatogramPeak.h:145
OpenMS::MSExperiment::addChromatogram
void addChromatogram(const MSChromatogram &chromatogram)
adds a chromatogram to the list
main
int main(int argc, const char **argv)
Definition: INIFileEditor.cpp:71
OpenMS::Element::symbol_
std::string symbol_
symbol of the element
Definition: Element.h:152
MSExperiment.h
OpenMS::TextFile::begin
ConstIterator begin() const
Gives access to the underlying text buffer.
OpenMS::SignedSize
ptrdiff_t SignedSize
Signed Size type e.g. used as pointer difference.
Definition: Types.h:134
OpenMS::IsotopeDistribution
Definition: IsotopeDistribution.h:64
OpenMS::Internal::operator==
bool operator==(const IDBoostGraph::ProteinGroup &lhs, const IDBoostGraph::ProteinGroup &rhs)
OpenMS::String::substr
String substr(size_t pos=0, size_t n=npos) const
Wrapper for the STL substr() method. Returns a String object with its contents initialized to a subst...
OpenMS::ConsensusMap::clear
void clear(bool clear_meta_data=true)
Clears all data and meta data.
OpenMS::MSExperiment::end
Iterator end()
Definition: MSExperiment.h:160
OpenMS::Element::mono_weight_
double mono_weight_
mono isotopic weight of the most frequent isotope
Definition: Element.h:161
MSChromatogram.h
PeakPickerCWT.h
OpenMS::MSChromatogram
The representation of a chromatogram.
Definition: MSChromatogram.h:53
OpenMS::TextFile::store
void store(const String &filename)
Writes the data to a file.
OpenMS::Param
Management and storage of parameters / INI files.
Definition: Param.h:69
OpenMS::String::concatenate
void concatenate(StringIterator first, StringIterator last, const String &glue="")
Concatenates all elements from first to last-1 and inserts glue between the elements.
Definition: String.h:468
OpenMS::MSExperiment::calculateTIC
const MSChromatogram calculateTIC(float rt_bin_size=0, UInt ms_level=1) const
Computes the total ion chromatogram (TIC) for a given MS level (use ms_level = 0 for all levels).
OpenMS::ChromatogramSettings::SELECTED_ION_CURRENT_CHROMATOGRAM
Definition: ChromatogramSettings.h:71
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::Element::isotopes_
IsotopeDistribution isotopes_
distribution of the isotopes (mass and natural frequency)
Definition: Element.h:164
OpenMS::Internal::AreaIterator::getRT
CoordinateType getRT() const
returns the retention time of the current scan
Definition: AreaIterator.h:198
PeakPickerHiRes.h
OpenMS::MSSpectrum
The representation of a 1D spectrum.
Definition: MSSpectrum.h:66
OpenMS::TextFile::load
void load(const String &filename, bool trim_lines=false, Int first_n=-1, bool skip_empty_lines=false)
Loads data from a text file.
File.h
OpenMS::ProgressLogger::setLogType
void setLogType(LogType type) const
Sets the progress log that should be used. The default type is NONE!
OpenMS::GaussFilter
This class represents a Gaussian lowpass-filter which works on uniform as well as on non-uniform prof...
Definition: GaussFilter.h:70
TOPPBase.h
OpenMS::MSExperiment::RTBegin
ConstIterator RTBegin(CoordinateType rt) const
Fast search for spectrum range begin.
SignalToNoiseEstimatorMedian.h
StringListUtils.h