libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
filternormalizeintensities.h
Go to the documentation of this file.
1/* BEGIN software license
2 *
3 * msXpertSuite - mass spectrometry software suite
4 * -----------------------------------------------
5 * Copyright(C) 2009,...,2021 Filippo Rusconi
6 *
7 * http://www.msxpertsuite.org
8 *
9 * This file is part of the msXpertSuite project.
10 *
11 * The msXpertSuite project is the successor of the massXpert project. This
12 * project now includes various independent modules:
13 *
14 * - massXpert, model polymer chemistries and simulate mass spectrometric data;
15 * - mineXpert, a powerful TIC chromatogram/mass spectrum viewer/miner;
16 *
17 * This program is free software: you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation, either version 3 of the License, or
20 * (at your option) any later version.
21 *
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
26 *
27 * You should have received a copy of the GNU General Public License
28 * along with this program. If not, see <http://www.gnu.org/licenses/>.
29 *
30 * END software license
31 */
32
33
34#pragma once
35
36
37#include <QObject>
38
39#include "../../trace/trace.h"
41#include "filternameinterface.h"
42
43
44namespace pappso
45{
46
47
48class FilterNormalizeIntensities;
49
50typedef std::shared_ptr<FilterNormalizeIntensities>
52typedef std::shared_ptr<const FilterNormalizeIntensities>
54
55
56/**
57 * @brief Sets the maximum intensity of the trace to the provided value
58 *
59 * All the other values are modified by applying the same modification ratio.
60 *
61 * The amplitude of the trace is computed (maxValue - minValue)
62 * The new maxValue is set to the required intensity.
63 * All the other data points have their intensity modified:
64 *
65 * new_intensity = previous_intensity / old_max_value * new_max_value
66 */
68{
69 public:
70 FilterNormalizeIntensities(double new_max_y_value);
71 FilterNormalizeIntensities(const QString &parameters);
73
75
77 operator=(const FilterNormalizeIntensities &other);
78
79 Trace &filter(Trace &data_points) const override;
80 QString name() const override;
81 QString toString() const override;
82
83 protected:
84 void buildFilterFromString(const QString &strBuildParams) override;
85
86 private:
87 static constexpr double nan = std::numeric_limits<double>::quiet_NaN();
88
89 double m_newYMax;
90};
91} // namespace pappso
Interface that allows to build filter objects from strings.
Sets the maximum intensity of the trace to the provided value.
A simple container of DataPoint instances.
Definition trace.h:148
#define PMSPP_LIB_DECL
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
std::shared_ptr< const FilterNormalizeIntensities > FilterNormalizeIntensitiesCstSPtr
std::shared_ptr< FilterNormalizeIntensities > FilterNormalizeIntensitiesSPtr