Loading...
Searching...
No Matches
mzrange.h
Go to the documentation of this file.
/**
* \file pappsomspp/mass_range.h
* \date 4/3/2015
* \author Olivier Langella
* \brief object to handle a mass range (an mz value + or - some delta)
*/
/*******************************************************************************
* Copyright (c) 2015 Olivier Langella <Olivier.Langella@moulon.inra.fr>.
*
* This file is part of the PAPPSOms++ library.
*
* PAPPSOms++ is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PAPPSOms++ is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* Olivier Langella <Olivier.Langella@moulon.inra.fr> - initial API and
*implementation
******************************************************************************/
#pragma once
#include "pappsomspp/core/types.h"
#include "pappsomspp/core/precision.h"
#include "pappsomspp/export-import-config.h"
#include <QString>
#include <map>
namespace pappso
{
class PMSPP_LIB_DECL MzRange
{
public:
MzRange(pappso_double mz, PrecisionPtr precision);
MzRange(pappso_double mz, pappso_double delta);
MzRange(pappso_double mz,
PrecisionPtr precision_lower,
PrecisionPtr precision_upper);
MzRange(const MzRange &other);
virtual ~MzRange();
MzRange &operator=(const MzRange &other);
MzRange &operator+=(const MzRange &other);
MzRange &operator*=(double number);
pappso_double getMz() const;
bool contains(pappso_double) const;
QString toString() const;
pappso_double
lower() const
{
return (m_mz - m_delta);
};
pappso_double
upper() const
{
return (m_mz + m_delta);
};
private:
pappso_double m_mz;
pappso_double m_delta;
};
} // namespace pappso
pappso::MzRange::getMz
pappso_double getMz() const
Definition mzrange.cpp:109
pappso::MzRange::operator+=
MzRange & operator+=(const MzRange &other)
Definition mzrange.cpp:91
pappso::MzRange::toString
QString toString() const
Definition mzrange.cpp:126
pappso::MzRange::operator=
MzRange & operator=(const MzRange &other)
Definition mzrange.cpp:81
pappso::MzRange::lower
pappso_double lower() const
Definition mzrange.h:71
pappso::MzRange::MzRange
MzRange(pappso_double mz, PrecisionPtr precision)
Definition mzrange.cpp:42
pappso::MzRange::upper
pappso_double upper() const
Definition mzrange.h:77
pappso::MzRange::operator*=
MzRange & operator*=(double number)
Definition mzrange.cpp:100
pappso::MzRange::m_delta
pappso_double m_delta
Definition mzrange.h:85
pappso::MzRange::m_mz
pappso_double m_mz
Definition mzrange.h:84
pappso::MzRange::contains
bool contains(pappso_double) const
Definition mzrange.cpp:115
export-import-config.h
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition export-import-config.h:14
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition types.h:60
pappso::PrecisionPtr
const PrecisionBase * PrecisionPtr
Definition precision.h:122
precision.h
types.h