Loading...
Searching...
No Matches
psmspecpeptidoms.h
Go to the documentation of this file.
/**
* \file pappsomspp/processing/cbor/psm/evalscan/psmspecglob.h
* \date 19/07/2025
* \author Olivier Langella
* \brief compute specglob alignment on scan's PSM
*/
/*******************************************************************************
* Copyright (c) 2025 Olivier Langella <Olivier.Langella@universite-paris-saclay.fr>.
*
* This file is part of PAPPSOms-tools.
*
* PAPPSOms-tools 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-tools 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-tools. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#pragma once
#include "pappsomspp/core/processing/cbor/psm/psmfilescanprocessandcopy.h"
#include "pappsomspp/core/amino_acid/aacode.h"
#include "pappsomspp/core/processing/specpeptidoms/scorevalues.h"
#include "pappsomspp/core/processing/specpeptidoms/semiglobalalignment.h"
#include <QJsonObject>
#include "pappsomspp/export-import-config.h"
namespace pappso
{
namespace cbor
{
namespace psm
{
class PsmSpecPeptidOmsScan;
/**
* @todo write docs
*/
class PMSPP_LIB_DECL PsmSpecPeptidOms : public PsmFileScanProcessAndCopy
{
friend PsmSpecPeptidOmsScan;
public:
/**
* Default constructor
*/
PsmSpecPeptidOms(std::size_t buffer_scan_size,
CborStreamWriter *cbor_output_p,
const QJsonObject &parameters);
/**
* Destructor
*/
virtual ~PsmSpecPeptidOms();
void filterMassSpectrum(pappso::MassSpectrum &mass_spectrum) const;
const pappso::AaCode &getAaCode() const;
protected:
CborScanMapBase *newCborScanMap() override;
void parameterMapReady(pappso::UiMonitorInterface &monitor) override;
virtual void processBufferScanDone(pappso::UiMonitorInterface &monitor) override;
virtual void proteinMapReady(pappso::UiMonitorInterface &monitor) override;
protected:
pappso::AaCode m_aaCode;
QJsonObject m_specpeptidomsParameters;
pappso::PrecisionPtr m_fragmentTolerance;
double m_minimumMz;
std::size_t m_nMostIntense;
bool m_deisotope = true;
pappso::specpeptidoms::ScoreValues m_scoreValues;
std::size_t m_countScanProcessed = 0;
pappso::cbor::psm::PsmProteinMap m_newProteinMap;
QString m_decoyPrefix;
std::size_t m_maxInterpretationsPerSpectrum = 1;
};
class PsmSpecPeptidOmsScan : public CborScanMapBase
{
public:
/**
* Default constructor
*/
PsmSpecPeptidOmsScan(const PsmSpecPeptidOms &psm_specpeptidoms,
pappso::PrecisionPtr fragment_tolerance);
/**
* Destructor
*/
virtual ~PsmSpecPeptidOmsScan();
virtual void filterAndSortPsmList() override;
protected:
void process() override;
void sequenceAlignment(bool is_reverse,
const QCborMap &old_cbor_psm_map,
QCborArray &new_psm_arr,
pappso::specpeptidoms::SpOMSSpectrumCsp &experimental_spectrum,
pappso::specpeptidoms::SemiGlobalAlignment &semi_global_alignment,
const pappso::specpeptidoms::SpOMSProtein *protein_ptr);
void storeAlignment(bool is_reverse,
const QCborMap &old_cbor_psm,
QCborMap &new_cbor_psm,
const QString &accession,
const pappso::specpeptidoms::Alignment &alignment);
void fixPositionStart(bool is_reverse, QCborMap &new_cbor_psm, std::size_t offset_position) const;
private:
const PsmSpecPeptidOms *mp_psmSpecPeptidOms;
QString m_decoyPrefix;
};
} // namespace psm
} // namespace cbor
} // namespace pappso
aacode.h
pappso::AaCode
collection of integer code for each amino acid 0 => null 1 to 20 => amino acid sorted by there mass (...
Definition aacode.h:44
pappso::MassSpectrum
Class to represent a mass spectrum.
Definition massspectrum.h:70
pappso::UiMonitorInterface
Definition uimonitorinterface.h:50
pappso::cbor::CborStreamWriter
overrides QCborStreamWriter base class to provide convenient functions
Definition cborstreamwriter.h:45
pappso::cbor::psm::CborScanMapBase
Definition cborscanmapbase.h:48
pappso::cbor::psm::CborScanMapBase::CborScanMapBase
CborScanMapBase(const PsmFileScanProcess &psm_file_scan_process)
Definition cborscanmapbase.cpp:40
pappso::cbor::psm::PsmFileScanProcessAndCopy::PsmFileScanProcessAndCopy
PsmFileScanProcessAndCopy(std::size_t buffer_scan_size, CborStreamWriter *cbor_output_p, const QString &operation)
Definition psmfilescanprocessandcopy.cpp:41
pappso::cbor::psm::PsmProteinMap
store PsmProtein in a map with accession as key
Definition psmproteinmap.h:56
pappso::cbor::psm::PsmSpecPeptidOmsScan
Definition psmspecpeptidoms.h:99
pappso::cbor::psm::PsmSpecPeptidOmsScan::sequenceAlignment
void sequenceAlignment(bool is_reverse, const QCborMap &old_cbor_psm_map, QCborArray &new_psm_arr, pappso::specpeptidoms::SpOMSSpectrumCsp &experimental_spectrum, pappso::specpeptidoms::SemiGlobalAlignment &semi_global_alignment, const pappso::specpeptidoms::SpOMSProtein *protein_ptr)
Definition psmspecpeptidoms.cpp:249
pappso::cbor::psm::PsmSpecPeptidOmsScan::storeAlignment
void storeAlignment(bool is_reverse, const QCborMap &old_cbor_psm, QCborMap &new_cbor_psm, const QString &accession, const pappso::specpeptidoms::Alignment &alignment)
Definition psmspecpeptidoms.cpp:403
pappso::cbor::psm::PsmSpecPeptidOmsScan::fixPositionStart
void fixPositionStart(bool is_reverse, QCborMap &new_cbor_psm, std::size_t offset_position) const
Definition psmspecpeptidoms.cpp:481
pappso::cbor::psm::PsmSpecPeptidOmsScan::~PsmSpecPeptidOmsScan
virtual ~PsmSpecPeptidOmsScan()
Definition psmspecpeptidoms.cpp:155
pappso::cbor::psm::PsmSpecPeptidOmsScan::process
void process() override
Definition psmspecpeptidoms.cpp:160
pappso::cbor::psm::PsmSpecPeptidOmsScan::filterAndSortPsmList
virtual void filterAndSortPsmList() override
Definition psmspecpeptidoms.cpp:355
pappso::cbor::psm::PsmSpecPeptidOmsScan::mp_psmSpecPeptidOms
const PsmSpecPeptidOms * mp_psmSpecPeptidOms
Definition psmspecpeptidoms.h:134
pappso::cbor::psm::PsmSpecPeptidOmsScan::PsmSpecPeptidOmsScan
PsmSpecPeptidOmsScan(const PsmSpecPeptidOms &psm_specpeptidoms, pappso::PrecisionPtr fragment_tolerance)
Definition psmspecpeptidoms.cpp:145
pappso::cbor::psm::PsmSpecPeptidOmsScan::m_decoyPrefix
QString m_decoyPrefix
Definition psmspecpeptidoms.h:135
pappso::cbor::psm::PsmSpecPeptidOms
Definition psmspecpeptidoms.h:48
pappso::cbor::psm::PsmSpecPeptidOms::parameterMapReady
void parameterMapReady(pappso::UiMonitorInterface &monitor) override
Definition psmspecpeptidoms.cpp:120
pappso::cbor::psm::PsmSpecPeptidOms::proteinMapReady
virtual void proteinMapReady(pappso::UiMonitorInterface &monitor) override
Definition psmspecpeptidoms.cpp:97
pappso::cbor::psm::PsmSpecPeptidOms::PsmSpecPeptidOms
PsmSpecPeptidOms(std::size_t buffer_scan_size, CborStreamWriter *cbor_output_p, const QJsonObject &parameters)
Definition psmspecpeptidoms.cpp:40
pappso::cbor::psm::PsmSpecPeptidOms::getAaCode
const pappso::AaCode & getAaCode() const
Definition psmspecpeptidoms.cpp:139
pappso::cbor::psm::PsmSpecPeptidOms::m_countScanProcessed
std::size_t m_countScanProcessed
Definition psmspecpeptidoms.h:91
pappso::cbor::psm::PsmSpecPeptidOms::PsmSpecPeptidOmsScan
friend PsmSpecPeptidOmsScan
Definition psmspecpeptidoms.h:49
pappso::cbor::psm::PsmSpecPeptidOms::filterMassSpectrum
void filterMassSpectrum(pappso::MassSpectrum &mass_spectrum) const
Definition psmspecpeptidoms.cpp:88
pappso::cbor::psm::PsmSpecPeptidOms::m_scoreValues
pappso::specpeptidoms::ScoreValues m_scoreValues
Definition psmspecpeptidoms.h:88
pappso::cbor::psm::PsmSpecPeptidOms::m_nMostIntense
std::size_t m_nMostIntense
Definition psmspecpeptidoms.h:86
pappso::cbor::psm::PsmSpecPeptidOms::m_aaCode
pappso::AaCode m_aaCode
Definition psmspecpeptidoms.h:82
pappso::cbor::psm::PsmSpecPeptidOms::m_newProteinMap
pappso::cbor::psm::PsmProteinMap m_newProteinMap
Definition psmspecpeptidoms.h:92
pappso::cbor::psm::PsmSpecPeptidOms::m_decoyPrefix
QString m_decoyPrefix
Definition psmspecpeptidoms.h:93
pappso::cbor::psm::PsmSpecPeptidOms::m_minimumMz
double m_minimumMz
Definition psmspecpeptidoms.h:85
pappso::cbor::psm::PsmSpecPeptidOms::m_fragmentTolerance
pappso::PrecisionPtr m_fragmentTolerance
Definition psmspecpeptidoms.h:84
pappso::cbor::psm::PsmSpecPeptidOms::m_maxInterpretationsPerSpectrum
std::size_t m_maxInterpretationsPerSpectrum
Definition psmspecpeptidoms.h:94
pappso::cbor::psm::PsmSpecPeptidOms::m_specpeptidomsParameters
QJsonObject m_specpeptidomsParameters
Definition psmspecpeptidoms.h:83
pappso::cbor::psm::PsmSpecPeptidOms::newCborScanMap
CborScanMapBase * newCborScanMap() override
Definition psmspecpeptidoms.cpp:133
pappso::cbor::psm::PsmSpecPeptidOms::processBufferScanDone
virtual void processBufferScanDone(pappso::UiMonitorInterface &monitor) override
Definition psmspecpeptidoms.cpp:77
pappso::cbor::psm::PsmSpecPeptidOms::m_deisotope
bool m_deisotope
Definition psmspecpeptidoms.h:87
pappso::specpeptidoms::ScoreValues
Definition scorevalues.h:29
pappso::specpeptidoms::SemiGlobalAlignment
Definition semiglobalalignment.h:92
pappso::specpeptidoms::SpOMSProtein
Definition spomsprotein.h:38
export-import-config.h
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition export-import-config.h:14
pappso::cbor::psm
Definition cborscanmapbase.h:40
pappso::cbor
Definition cborstreamreader.cpp:35
pappso::specpeptidoms::SpOMSSpectrumCsp
std::shared_ptr< const SpOMSSpectrum > SpOMSSpectrumCsp
Definition spomsspectrum.h:66
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
pappso::PrecisionPtr
const PrecisionBase * PrecisionPtr
Definition precision.h:122
psmfilescanprocessandcopy.h
semiglobalalignment.h
scorevalues.h
pappso::specpeptidoms::Alignment
Definition semiglobalalignment.h:57