Loading...
Searching...
No Matches
filternormalizeintensities.h
Go to the documentation of this file.
/* BEGIN software license
*
* msXpertSuite - mass spectrometry software suite
* -----------------------------------------------
* Copyright(C) 2009,...,2021 Filippo Rusconi
*
* http://www.msxpertsuite.org
*
* This file is part of the msXpertSuite project.
*
* The msXpertSuite project is the successor of the massXpert project. This
* project now includes various independent modules:
*
* - massXpert, model polymer chemistries and simulate mass spectrometric data;
* - mineXpert, a powerful TIC chromatogram/mass spectrum viewer/miner;
*
* This program 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.
*
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*
* END software license
*/
#pragma once
#include <QObject>
#include "../../trace/trace.h"
#include "pappsomspp/export-import-config.h"
#include "filternameinterface.h"
namespace pappso
{
class FilterNormalizeIntensities;
typedef std::shared_ptr<FilterNormalizeIntensities>
FilterNormalizeIntensitiesSPtr;
typedef std::shared_ptr<const FilterNormalizeIntensities>
FilterNormalizeIntensitiesCstSPtr;
/**
* @brief Sets the maximum intensity of the trace to the provided value
*
* All the other values are modified by applying the same modification ratio.
*
* The amplitude of the trace is computed (maxValue - minValue)
* The new maxValue is set to the required intensity.
* All the other data points have their intensity modified:
*
* new_intensity = previous_intensity / old_max_value * new_max_value
*/
class PMSPP_LIB_DECL FilterNormalizeIntensities : public FilterNameInterface
{
public:
FilterNormalizeIntensities(double new_max_y_value);
FilterNormalizeIntensities(const QString &parameters);
FilterNormalizeIntensities(const FilterNormalizeIntensities &other);
virtual ~FilterNormalizeIntensities();
FilterNormalizeIntensities &
operator=(const FilterNormalizeIntensities &other);
Trace &filter(Trace &data_points) const override;
QString name() const override;
QString toString() const override;
protected:
void buildFilterFromString(const QString &strBuildParams) override;
private:
static constexpr double nan = std::numeric_limits<double>::quiet_NaN();
double m_newYMax;
};
} // namespace pappso
pappso::FilterNameInterface
Interface that allows to build filter objects from strings.
Definition filternameinterface.h:42
pappso::FilterNormalizeIntensities
Sets the maximum intensity of the trace to the provided value.
Definition filternormalizeintensities.h:68
pappso::FilterNormalizeIntensities::toString
QString toString() const override
Return a string with the textual representation of the configuration data.
Definition filternormalizeintensities.cpp:138
pappso::FilterNormalizeIntensities::buildFilterFromString
void buildFilterFromString(const QString &strBuildParams) override
build this filter using a string
Definition filternormalizeintensities.cpp:86
pappso::FilterNormalizeIntensities::filter
Trace & filter(Trace &data_points) const override
Definition filternormalizeintensities.cpp:104
pappso::FilterNormalizeIntensities::operator=
FilterNormalizeIntensities & operator=(const FilterNormalizeIntensities &other)
Definition filternormalizeintensities.cpp:74
pappso::FilterNormalizeIntensities::FilterNormalizeIntensities
FilterNormalizeIntensities(double new_max_y_value)
Definition filternormalizeintensities.cpp:50
pappso::FilterNormalizeIntensities::m_newYMax
double m_newYMax
Definition filternormalizeintensities.h:89
pappso::FilterNormalizeIntensities::nan
static constexpr double nan
Definition filternormalizeintensities.h:87
pappso::FilterNormalizeIntensities::name
QString name() const override
Definition filternormalizeintensities.cpp:145
pappso::Trace
A simple container of DataPoint instances.
Definition trace.h:152
export-import-config.h
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition export-import-config.h:14
filternameinterface.h
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
pappso::FilterNormalizeIntensitiesCstSPtr
std::shared_ptr< const FilterNormalizeIntensities > FilterNormalizeIntensitiesCstSPtr
Definition filternormalizeintensities.h:53
pappso::FilterNormalizeIntensitiesSPtr
std::shared_ptr< FilterNormalizeIntensities > FilterNormalizeIntensitiesSPtr
Definition filternormalizeintensities.h:51
trace.h