libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
psmspecglob.cpp
Go to the documentation of this file.
1/**
2 * \file pappsomspp/processing/cbor/psm/evalscan/psmspecglob.cpp
3 * \date 19/07/2025
4 * \author Olivier Langella
5 * \brief compute specglob alignment on scan's PSM
6 */
7
8/*******************************************************************************
9 * Copyright (c) 2025 Olivier Langella <Olivier.Langella@universite-paris-saclay.fr>.
10 *
11 * This file is part of PAPPSOms-tools.
12 *
13 * PAPPSOms-tools is free software: you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation, either version 3 of the License, or
16 * (at your option) any later version.
17 *
18 * PAPPSOms-tools is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with PAPPSOms-tools. If not, see <http://www.gnu.org/licenses/>.
25 *
26 ******************************************************************************/
27
28#include "psmspecglob.h"
29#include "psmspecglobscan.h"
34
36 pappso::cbor::CborStreamWriter *cbor_output_p,
37 const QJsonObject &parameters)
38 : PsmFileScanProcessAndCopy(buffer_scan_size, cbor_output_p, "SpecGlob")
39{
40 qDebug();
41 m_specglobParameters = parameters;
42
43 if(parameters.value("fragment_tolerance_unit").toString() == "dalton")
44 {
46 parameters.value("fragment_tolerance").toDouble());
47 }
48 else if(parameters.value("fragment_tolerance_unit").toString() == "ppm")
49 {
51 pappso::PrecisionFactory::getPpmInstance(parameters.value("fragment_tolerance").toDouble());
52 }
53
54 QJsonObject spectrum_param = parameters.value("spectrum").toObject();
55
56 m_minimumMz = spectrum_param.value("minimum_mz").toDouble();
57 m_nMostIntense = spectrum_param.value("n_most_intense").toInt();
58 m_deisotope = spectrum_param.value("deisotope").toBool();
59 qDebug();
60}
61
65
66void
68 [[maybe_unused]])
69{
70 qDebug();
71 QCborMap cbor_specglob_parameters = QCborValue::fromJsonValue(m_specglobParameters).toMap();
72
73
74 m_cborParameterMap.insert(QString("specglob"), cbor_specglob_parameters);
75
76
77 mp_cborOutput->append("parameter_map");
78 mp_cborOutput->writeCborMap(m_cborParameterMap);
79 qDebug();
80}
81
82
83void
91
92
Trace & filter(Trace &data_points) const override
get all the datapoints and remove different isotope and add their intensity and change to charge = 1 ...
keep N datapoints form the greatest intensities to the lowest
Definition filterpass.h:96
Trace & filter(Trace &data_points) const override
Trace & filter(Trace &trace) const override
Class to represent a mass spectrum.
static PrecisionPtr getPpmInstance(pappso_double value)
get a ppm precision pointer
static PrecisionPtr getDaltonInstance(pappso_double value)
get a Dalton precision pointer
PsmFileScanProcessAndCopy(std::size_t buffer_scan_size, CborStreamWriter *cbor_output_p, const QString &operation)
pappso::cbor::psm::CborScanMapBase * newCborScanMap() override
pappso::PrecisionPtr m_fragmentTolerance
Definition psmspecglob.h:62
void filterMassSpectrum(pappso::MassSpectrum &mass_spectrum) const
void parameterMapReady(pappso::UiMonitorInterface &monitor) override
PsmSpecGlob(std::size_t buffer_scan_size, CborStreamWriter *cbor_output_p, const QJsonObject &parameters)