OpenMS  2.6.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-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: Timo Sachsenberg $
32 // $Authors: Andreas Bertsch $
33 // --------------------------------------------------------------------------
34 //
35 
36 #pragma once
37 
38 #include <OpenMS/CONCEPT/Types.h>
41 
42 #define OPENMS_CHEMISTRY_ELEMENT_NAME_DEFAULT "unknown"
43 #define OPENMS_CHEMISTRY_ELEMENT_SYMBOL_DEFAULT "??"
44 #define OPENMS_CHEMISTRY_ELEMENT_WEIGHT_DEFAULT 0.0
45 #define OPENMS_CHEMISTRY_ELEMENT_ATOMICNUMBER_DEFAULT 0
46 
47 namespace OpenMS
48 {
53  class OPENMS_DLLAPI Element
54  {
55 public:
56 
57 
61  Element();
63 
65  Element(const Element & element);
66 
68  Element(const String & name,
69  const String & symbol,
70  UInt atomic_number,
71  double average_weight,
72  double mono_weight,
73  const IsotopeDistribution & isotopes);
74 
76  virtual ~Element();
78 
82  void setAtomicNumber(UInt atomic_number);
84 
86  UInt getAtomicNumber() const;
87 
89  void setAverageWeight(double weight);
90 
92  double getAverageWeight() const;
93 
95  void setMonoWeight(double weight);
96 
98  double getMonoWeight() const;
99 
101  void setIsotopeDistribution(const IsotopeDistribution & isotopes);
102 
104  const IsotopeDistribution & getIsotopeDistribution() const;
105 
107  void setName(const String & name);
108 
110  const String & getName() const;
111 
113  void setSymbol(const String & symbol);
114 
116  const String & getSymbol() const;
118 
122  Element & operator=(const Element & element);
125 
129  bool operator==(const Element & element) const;
131 
133  bool operator!=(const Element & element) const;
134 
136  bool operator<(const Element & element) const;
138 
140  friend OPENMS_DLLAPI std::ostream & operator<<(std::ostream & os, const Element & element);
141 
142 protected:
143 
146 
149 
152 
155 
157  double mono_weight_;
158 
161  };
162 
163  OPENMS_DLLAPI std::ostream & operator<<(std::ostream &, const Element &);
164 
165 } // namespace OpenMS
166 
EDTAFile.h
OpenMS::TOPPBase
Base class for TOPP applications.
Definition: TOPPBase.h:144
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
ListUtilsIO.h
double
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:154
OpenMS::Element
Representation of an element.
Definition: Element.h:53
OpenMS::File::basename
static String basename(const String &file)
Returns the basename of the file (without the path).
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:121
OpenMS::Peak2D
A 2-dimensional raw data point or peak.
Definition: Peak2D.h:54
OpenMS::Param::setValue
void setValue(const String &key, const DataValue &value, const String &description="", const StringList &tags=StringList())
Sets a value.
OpenMS::EDTAFile
File adapter for Enhanced DTA files.
Definition: EDTAFile.h:85
OpenMS::MzMLFile
File adapter for MzML files.
Definition: MzMLFile.h:55
OpenMS::String
A more convenient string class.
Definition: String.h:59
OpenMS::MSExperiment::begin
Iterator begin()
Definition: MSExperiment.h:157
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.
Definition: GaussFilter.h:92
OpenMS::MSExperiment
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:77
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::Size
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
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:100
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::operator<
bool operator<(const QTCluster &q1, const QTCluster &q2)
OpenMS::Element::atomic_number_
UInt atomic_number_
atomic number of the element
Definition: Element.h:151
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)
Non-mutable access to the data point intensity (height)
Definition: Peak2D.h:172
OpenMS::MSExperiment::size
Size size() const
Definition: MSExperiment.h:127
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:193
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:46
OpenMS::MSExperiment::Iterator
std::vector< SpectrumType >::iterator Iterator
Mutable iterator.
Definition: MSExperiment.h:111
OpenMS::PeakPickerHiRes
This class implements a fast peak-picking algorithm best suited for high resolution MS data (FT-ICR-M...
Definition: PeakPickerHiRes.h:73
OpenMS::SignalToNoiseEstimator::getSignalToNoise
virtual double getSignalToNoise(const Size index) const
Definition: SignalToNoiseEstimator.h:108
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.
int
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::Element::symbol_
String symbol_
symbol of the element
Definition: Element.h:148
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::MSExperiment::getTIC
const MSChromatogram getTIC(float rt_bin_size=0) const
Compute Total Ion Count per MS1 spectrum and applies the resampling algorithm, if a bin size in RT se...
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:137
OpenMS::Peak1D
A 1-dimensional raw data point or peak.
Definition: Peak1D.h:54
OpenMS::operator<<
std::ostream & operator<<(std::ostream &os, const AccurateMassSearchResult &amsr)
OpenMS::ConsensusMap
A container for consensus elements.
Definition: ConsensusMap.h:80
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::UInt
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
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:73
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:167
OpenMS::Element::mono_weight_
double mono_weight_
mono isotopic weight of the most frequent isotope
Definition: Element.h:157
MSChromatogram.h
OpenMS::ConsensusMap::Iterator
std::vector< ConsensusFeature >::iterator Iterator
Mutable iterator.
Definition: ConsensusMap.h:170
PeakPickerCWT.h
OpenMS::MSChromatogram
The representation of a chromatogram.
Definition: MSChromatogram.h:54
OpenMS::Element::name_
String name_
name of the element
Definition: Element.h:145
String.h
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:73
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:467
OpenMS::ChromatogramSettings::SELECTED_ION_CURRENT_CHROMATOGRAM
Definition: ChromatogramSettings.h:71
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::Element::isotopes_
IsotopeDistribution isotopes_
distribution of the isotopes
Definition: Element.h:160
OpenMS::Internal::AreaIterator::getRT
CoordinateType getRT() const
returns the retention time of the current scan
Definition: AreaIterator.h:198
PeakPickerHiRes.h
OpenMS::MSSpectrum::ConstIterator
ContainerType::const_iterator ConstIterator
Non-mutable iterator.
Definition: MSSpectrum.h:128
OpenMS::MSSpectrum
The representation of a 1D spectrum.
Definition: MSSpectrum.h:67
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:74
TOPPBase.h
OpenMS::MSExperiment::RTBegin
ConstIterator RTBegin(CoordinateType rt) const
Fast search for spectrum range begin.
SignalToNoiseEstimatorMedian.h
StringListUtils.h