Loading...
Searching...
No Matches
psmspecpeptidoms.cpp
Go to the documentation of this file.
/**
* \file pappsomspp/processing/cbor/psm/evalscan/psmspecglob.cpp
* \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/>.
*
******************************************************************************/
#include "psmspecpeptidoms.h"
#include "pappsomspp/core/processing/cbor/psm/psmcborutils.h"
#include "pappsomspp/core/processing/filters/filterchargedeconvolution.h"
#include "pappsomspp/core/processing/filters/filterresample.h"
#include "pappsomspp/core/processing/filters/filterpass.h"
#include "pappsomspp/core/peptide/peptideproformaparser.h"
#include "pappsomspp/core/pappsoexception.h"
#include "pappsomspp/core/exception/exceptionoutofrange.h"
#include "pappsomspp/core/processing/specpeptidoms/spomsspectrum.h"
pappso::cbor::psm::PsmSpecPeptidOms::PsmSpecPeptidOms(std::size_t buffer_scan_size,
pappso::cbor::CborStreamWriter *cbor_output_p,
const QJsonObject &parameters)
: PsmFileScanProcessAndCopy(buffer_scan_size, cbor_output_p, "SpecPeptidOms")
{
m_specpeptidomsParameters = parameters;
if(parameters.value("fragment_tolerance_unit").toString() == "dalton")
{
m_fragmentTolerance = pappso::PrecisionFactory::getDaltonInstance(
parameters.value("fragment_tolerance").toDouble());
}
else if(parameters.value("fragment_tolerance_unit").toString() == "ppm")
{
m_fragmentTolerance =
pappso::PrecisionFactory::getPpmInstance(parameters.value("fragment_tolerance").toDouble());
}
QJsonObject spectrum_param = parameters.value("spectrum").toObject();
m_minimumMz = spectrum_param.value("minimum_mz").toDouble();
m_nMostIntense = spectrum_param.value("n_most_intense").toInt();
m_deisotope = spectrum_param.value("deisotope").toBool();
m_aaCode.addAaModification('C', AaModification::getInstance("MOD:00397"));
m_maxInterpretationsPerSpectrum = parameters.value("max_interpretations_per_spectrum").toInt();
delayProteinMapInMemory();
}
pappso::cbor::psm::PsmSpecPeptidOms::~PsmSpecPeptidOms()
{
}
void
pappso::cbor::psm::PsmSpecPeptidOms::processBufferScanDone(pappso::UiMonitorInterface &monitor)
{
PsmFileScanProcessAndCopy::processBufferScanDone(monitor);
m_countScanProcessed += m_bufferScanSize;
monitor.setStatus(QObject::tr("%1 scan processed").arg(m_countScanProcessed));
}
void
pappso::cbor::psm::PsmSpecPeptidOms::filterMassSpectrum(pappso::MassSpectrum &mass_spectrum) const
{
if(m_deisotope)
pappso::FilterChargeDeconvolution(m_fragmentTolerance).filter(mass_spectrum);
pappso::FilterResampleKeepGreater(m_minimumMz).filter(mass_spectrum);
pappso::FilterGreatestY(m_nMostIntense).filter(mass_spectrum);
}
void
pappso::cbor::psm::PsmSpecPeptidOms::proteinMapReady(pappso::UiMonitorInterface &monitor)
{
if(!m_decoyPrefix.isEmpty())
{
// generate decoy sequences
PsmProtein new_decoy_protein;
for(auto &it_protein : m_proteinMap.getProteinMap())
{
new_decoy_protein = it_protein.second;
new_decoy_protein.protein_sp =
std::make_shared<Protein>(*new_decoy_protein.protein_sp.get());
new_decoy_protein.protein_sp.get()->reverse();
new_decoy_protein.protein_sp.get()->setAccession(
m_decoyPrefix + new_decoy_protein.protein_sp.get()->getAccession());
new_decoy_protein.isTarget = false;
}
}
PsmFileScanProcessAndCopy::proteinMapReady(monitor);
}
void
pappso::cbor::psm::PsmSpecPeptidOms::parameterMapReady(pappso::UiMonitorInterface &monitor
[[maybe_unused]])
{
QCborMap cbor_peptidoms_parameters = QCborValue::fromJsonValue(m_specpeptidomsParameters).toMap();
m_cborParameterMap.insert(QString("peptidoms"), cbor_peptidoms_parameters);
mp_cborOutput->append("parameter_map");
mp_cborOutput->writeCborMap(m_cborParameterMap);
}
pappso::cbor::psm::CborScanMapBase *
pappso::cbor::psm::PsmSpecPeptidOms::newCborScanMap()
{
return new PsmSpecPeptidOmsScan(*this, m_fragmentTolerance);
}
const pappso::AaCode &
pappso::cbor::psm::PsmSpecPeptidOms::getAaCode() const
{
return m_aaCode;
}
pappso::cbor::psm::PsmSpecPeptidOmsScan::PsmSpecPeptidOmsScan(
const pappso::cbor::psm::PsmSpecPeptidOms &psm_specpeptidoms,
pappso::PrecisionPtr fragment_tolerance [[maybe_unused]])
: CborScanMapBase(psm_specpeptidoms)
{
mp_psmSpecPeptidOms = &psm_specpeptidoms;
m_decoyPrefix = mp_psmSpecPeptidOms->m_decoyPrefix;
}
pappso::cbor::psm::PsmSpecPeptidOmsScan::~PsmSpecPeptidOmsScan()
{
}
void
pappso::cbor::psm::PsmSpecPeptidOmsScan::process()
{
// qWarning() << "PsmSpecPeptidOmsScan::process " << keys();
if(!keys().contains("id"))
{
throw pappso::PappsoException(QObject::tr("missing scan id"));
}
if(keys().contains("psm_list"))
{
QualifiedMassSpectrumSPtr qualified_mass_spectrum = getCurrentQualifiedMassSpectrumSPtr();
// qWarning() << "PsmSpecPeptidOmsScan::process "
// << qualified_mass_spectrum.get()->getMassSpectrumId().getSpectrumIndex();
mp_psmSpecPeptidOms->filterMassSpectrum(
*(qualified_mass_spectrum.get()->getMassSpectrumSPtr().get()));
pappso::specpeptidoms::SpOMSSpectrumCsp experimental_spectrum =
std::make_shared<pappso::specpeptidoms::SpOMSSpectrum>(
*qualified_mass_spectrum.get(),
mp_psmSpecPeptidOms->m_fragmentTolerance,
mp_psmSpecPeptidOms->getAaCode());
pappso::specpeptidoms::SemiGlobalAlignment semi_global_alignment(
mp_psmSpecPeptidOms->m_scoreValues,
mp_psmSpecPeptidOms->m_fragmentTolerance,
mp_psmSpecPeptidOms->m_aaCode);
QCborArray new_psm_arr;
for(QCborValue cbor_psm : value("psm_list").toArray())
{
QCborMap old_cbor_psm_map = cbor_psm.toMap();
if(!old_cbor_psm_map.keys().contains("proforma"))
{
throw pappso::PappsoException(
QObject::tr("missing proforma in psm %1").arg(old_cbor_psm_map.keys().size()));
}
pappso::PeptideSp peptide_sp = pappso::PeptideProFormaParser::parseString(
old_cbor_psm_map.value("proforma").toString());
pappso::specpeptidoms::SpOMSProtein protein(old_cbor_psm_map.value("proforma").toString(),
peptide_sp.get()->getSequence(),
mp_psmSpecPeptidOms->m_aaCode);
sequenceAlignment(false,
old_cbor_psm_map,
new_psm_arr,
experimental_spectrum,
semi_global_alignment,
&protein);
if(!m_decoyPrefix.isEmpty())
{
QString sequence = peptide_sp.get()->getSequence();
std::reverse(sequence.begin(), sequence.end());
pappso::specpeptidoms::SpOMSProtein protein_rev(
m_decoyPrefix + old_cbor_psm_map.value("proforma").toString(),
sequence,
mp_psmSpecPeptidOms->m_aaCode);
sequenceAlignment(true,
old_cbor_psm_map,
new_psm_arr,
experimental_spectrum,
semi_global_alignment,
&protein_rev);
}
// qWarning() << "new_psm_arr.size()=" << new_psm_arr.size();
}
// insert(QString("psm_list"), new_psm_arr);
remove(QString("psm_list"));
insert(QString("psm_list"), new_psm_arr);
filterPsmListUniqueUniqueProforma();
}
// qWarning() << "PsmSpecPeptidOmsScan::process end";
}
void
pappso::cbor::psm::PsmSpecPeptidOmsScan::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)
{
std::vector<pappso::specpeptidoms::Location> locations;
std::vector<double> potential_mass_errors;
const QString &sequence = protein_ptr->getSequence();
// qWarning() << "PsmSpecPeptidOmsScan::process " << peptide_sequence;
// do not take into account peptide containing too much redundancy
if(pappso::specpeptidoms::SemiGlobalAlignment::checkSequenceDiversity(sequence, 5, 2))
{
if((sequence.size() >= 8) &&
(!pappso::specpeptidoms::SemiGlobalAlignment::checkSequenceDiversity(sequence, 8, 3)))
return;
semi_global_alignment.fastAlign(*experimental_spectrum.get(), protein_ptr);
// qDebug() << "Completed fastAlign";
locations = semi_global_alignment.getLocationSaver().getLocations();
qDebug() << "locations.size():" << locations.size();
for(auto loc : locations)
{
QCborMap new_cbor_psm;
qDebug() << "beginning=" << loc.beginning << "length=" << loc.length
<< "tree=" << loc.tree << "score=" << loc.score
<< "protein=" << loc.proteinPtr->getAccession();
semi_global_alignment.preciseAlign(
*experimental_spectrum.get(), loc.proteinPtr, loc.beginning, loc.length);
qDebug() << "Completed preciseAlign";
pappso::specpeptidoms::Alignment best_alignment =
semi_global_alignment.getBestAlignment();
/* qDebug() << "Best alignment" << best_alignment.interpretation
<< best_alignment.score << "SPC" << best_alignment.SPC
<< "beginning" << best_alignment.beginning << "end"
<< best_alignment.end;*/
if(best_alignment.end > (std::size_t)sequence.size())
{
throw pappso::ExceptionOutOfRange(QString("best_alignment.end > "
"(std::size_t)sequence.size() : %1 %2")
.arg(best_alignment.end)
.arg(sequence.size()));
}
if(best_alignment.begin_shift > 0 || best_alignment.end_shift > 0 ||
best_alignment.shifts.size() > 0)
{
qDebug();
potential_mass_errors =
pappso::specpeptidoms::SemiGlobalAlignment::getPotentialMassErrors(
mp_psmSpecPeptidOms->m_aaCode, best_alignment, sequence);
qDebug();
semi_global_alignment.postProcessingAlign(*experimental_spectrum.get(),
loc.proteinPtr,
loc.beginning,
loc.length,
potential_mass_errors);
qDebug() << "semi_global_alignment.getBestAlignment()";
pappso::specpeptidoms::Alignment best_post_processed_alignment =
semi_global_alignment.getBestAlignment();
if(best_post_processed_alignment.SPC > best_alignment.SPC)
{
qDebug() << "Best post-processed alignment"
<< best_post_processed_alignment.m_peptideModel.toInterpretation()
<< best_post_processed_alignment.score << "SPC"
<< best_post_processed_alignment.SPC;
storeAlignment(is_reverse,
old_cbor_psm_map,
new_cbor_psm,
protein_ptr->getAccession(),
best_post_processed_alignment);
}
else
{
qDebug() << "no improvement in post-processing";
storeAlignment(is_reverse,
old_cbor_psm_map,
new_cbor_psm,
protein_ptr->getAccession(),
best_alignment);
}
}
else
{
storeAlignment(is_reverse,
old_cbor_psm_map,
new_cbor_psm,
protein_ptr->getAccession(),
best_alignment);
}
if(!new_cbor_psm.isEmpty())
{
new_psm_arr.push_back(new_cbor_psm);
}
}
}
}
void
pappso::cbor::psm::PsmSpecPeptidOmsScan::filterAndSortPsmList()
{
std::size_t max_psm = mp_psmSpecPeptidOms->m_maxInterpretationsPerSpectrum;
struct sortPsmResults
{
qint64 score;
QCborMap psm;
};
QCborArray old_psm_arr = value("psm_list").toArray();
QCborArray new_psm_arr;
// for(QCborValue cbor_psm : old_psm_arr) {
std::vector<sortPsmResults> sort_psm_list;
for(auto it_psm : old_psm_arr)
{
QCborMap psm_map = it_psm.toMap();
qint64 score =
psm_map.value("eval").toMap().value("peptidoms").toMap().value("score").toInteger();
sort_psm_list.push_back({score, psm_map});
}
qDebug();
std::sort(sort_psm_list.begin(), sort_psm_list.end(), [](sortPsmResults &a, sortPsmResults &b) {
return a.score > b.score;
});
auto it_end = sort_psm_list.begin() + max_psm;
qDebug() << sort_psm_list.size();
for(auto it = sort_psm_list.begin(); it != sort_psm_list.end() && it != it_end; it++)
{
new_psm_arr.append(it->psm);
qDebug();
}
// qWarning() << new_psm_arr.size();
remove(QString("psm_list"));
insert(QString("psm_list"), new_psm_arr);
}
void
pappso::cbor::psm::PsmSpecPeptidOmsScan::storeAlignment(
bool is_reverse,
const QCborMap &old_cbor_psm,
QCborMap &new_cbor_psm,
const QString &accession,
const pappso::specpeptidoms::Alignment &alignment)
{
qDebug() << accession;
if(alignment.score > 0)
{
QString peptide_key(alignment.m_peptideModel.toProForma());
/*
{"proforma":"LHGAGADDADADD",
"protein_list":
[{
"accession": "GRMZM2G108267_P01",
"positions": [
337
]
}
{
"accession": "GRMZM2G108267_P02",
"positions": [
337
]
}
]
,
"eval":{
"matcher": {
"score": 193077
}
}
}
*/
// do not take into account peptide containing too much redundancy
if(pappso::specpeptidoms::SemiGlobalAlignment::checkSequenceDiversity(peptide_key, 5, 2))
{
// qDebug() << "peptide_key=" << peptide_key;
new_cbor_psm.insert(QString("proforma"), peptide_key);
// copy protein list in new psm
new_cbor_psm.insert(QString("protein_list"), old_cbor_psm.value("protein_list"));
fixPositionStart(is_reverse, new_cbor_psm, alignment.getPositionStart());
QCborMap cbor_eval;
QCborMap cbor_peptidoms;
// auto it_protein_pos =
// one_peptide_result.map_protein2positions.insert({accession, QCborArray()});
// it_protein_pos.first->second.append((qint64)alignment.getPositionStart());
cbor_peptidoms.insert(QString("bracket"), alignment.m_peptideModel.toInterpretation());
cbor_peptidoms.insert(QString("spc"), (qint64)alignment.SPC);
cbor_peptidoms.insert(QString("score"), alignment.score);
cbor_peptidoms.insert(QString("nam"), alignment.getNonAlignedMass());
// copy matcher eval in new psm
cbor_eval.insert(QString("matcher"), old_cbor_psm.value("eval").toMap().value("matcher"));
// store peptidoms eval in new psm
cbor_eval.insert(QString("peptidoms"), cbor_peptidoms);
new_cbor_psm.insert(QString("eval"), cbor_eval);
}
}
}
void
pappso::cbor::psm::PsmSpecPeptidOmsScan::fixPositionStart(bool is_reverse,
QCborMap &new_cbor_psm,
std::size_t offset_position) const
{
QCborArray new_protein_list;
for(auto qcbor_protein : new_cbor_psm.value("protein_list").toArray())
{
QCborMap protein;
QCborArray positions;
if(is_reverse)
{
protein.insert(QString("accession"),
m_decoyPrefix + qcbor_protein.toMap().value("accession").toString());
for(auto position : qcbor_protein.toMap().value("positions").toArray())
{
positions.append(position.toInteger() + (qint64)offset_position);
}
}
else
{
protein.insert(QString("accession"), qcbor_protein.toMap().value("accession"));
for(auto position : qcbor_protein.toMap().value("positions").toArray())
{
positions.append(position.toInteger() + (qint64)offset_position);
}
}
protein.insert(QString("positions"), positions.toCborValue());
new_protein_list.append(protein);
}
new_cbor_psm.insert(QString("protein_list"), new_protein_list);
}
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::AaModification::getInstance
static AaModificationP getInstance(const QString &accession)
Definition aamodification.cpp:368
pappso::ExceptionOutOfRange
Definition exceptionoutofrange.h:32
pappso::FilterChargeDeconvolution
Definition filterchargedeconvolution.h:43
pappso::FilterChargeDeconvolution::filter
Trace & filter(Trace &data_points) const override
get all the datapoints and remove different isotope and add their intensity and change to charge = 1 ...
Definition filterchargedeconvolution.cpp:115
pappso::FilterGreatestY
keep N datapoints form the greatest intensities to the lowest
Definition filterpass.h:96
pappso::FilterGreatestY::filter
Trace & filter(Trace &data_points) const override
Definition filterpass.cpp:163
pappso::FilterResampleKeepGreater
Definition filterresample.h:55
pappso::FilterResampleKeepGreater::filter
Trace & filter(Trace &trace) const override
Definition filterresample.cpp:79
pappso::MassSpectrum
Class to represent a mass spectrum.
Definition massspectrum.h:70
pappso::PappsoException
Definition pappsoexception.h:41
pappso::PeptideProFormaParser::parseString
static PeptideSp parseString(const QString &pepstr)
Definition peptideproformaparser.cpp:228
pappso::UiMonitorInterface
Definition uimonitorinterface.h:50
pappso::UiMonitorInterface::setStatus
virtual void setStatus(const QString &status)=0
current status of the process
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::filterPsmListUniqueUniqueProforma
void filterPsmListUniqueUniqueProforma()
Definition cborscanmapbase.cpp:268
pappso::cbor::psm::CborScanMapBase::CborScanMapBase
CborScanMapBase(const PsmFileScanProcess &psm_file_scan_process)
Definition cborscanmapbase.cpp:40
pappso::cbor::psm::CborScanMapBase::getCurrentQualifiedMassSpectrumSPtr
pappso::QualifiedMassSpectrumSPtr getCurrentQualifiedMassSpectrumSPtr() const
Definition cborscanmapbase.cpp:136
pappso::cbor::psm::PsmFileReaderBase::m_proteinMap
PsmProteinMap m_proteinMap
Definition psmfilereaderbase.h:129
pappso::cbor::psm::PsmFileReaderBase::m_cborParameterMap
QCborMap m_cborParameterMap
Definition psmfilereaderbase.h:135
pappso::cbor::psm::PsmFileScanProcessAndCopy::delayProteinMapInMemory
void delayProteinMapInMemory()
Definition psmfilescanprocessandcopy.cpp:69
pappso::cbor::psm::PsmFileScanProcessAndCopy::mp_cborOutput
CborStreamWriter * mp_cborOutput
Definition psmfilescanprocessandcopy.h:87
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::PsmFileScanProcessAndCopy::proteinMapReady
virtual void proteinMapReady(pappso::UiMonitorInterface &monitor) override
Definition psmfilescanprocessandcopy.cpp:153
pappso::cbor::psm::PsmFileScanProcessAndCopy::processBufferScanDone
virtual void processBufferScanDone(pappso::UiMonitorInterface &monitor) override
Definition psmfilescanprocessandcopy.cpp:169
pappso::cbor::psm::PsmFileScanProcess::m_bufferScanSize
std::size_t m_bufferScanSize
Definition psmfilescanprocess.h:73
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_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_decoyPrefix
QString m_decoyPrefix
Definition psmspecpeptidoms.h:93
pappso::cbor::psm::PsmSpecPeptidOms::~PsmSpecPeptidOms
virtual ~PsmSpecPeptidOms()
Definition psmspecpeptidoms.cpp:72
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::LocationSaver::getLocations
std::vector< Location > getLocations() const
Returns a vector containing the saved locations.
Definition locationsaver.cpp:126
pappso::specpeptidoms::PeptideModel::toProForma
QString toProForma() const
Definition peptidemodel.cpp:146
pappso::specpeptidoms::PeptideModel::toInterpretation
QString toInterpretation() const
Definition peptidemodel.cpp:181
pappso::specpeptidoms::SemiGlobalAlignment
Definition semiglobalalignment.h:92
pappso::specpeptidoms::SemiGlobalAlignment::getBestAlignment
const Alignment & getBestAlignment() const
Returns a const ref to m_best_alignment.
Definition semiglobalalignment.cpp:1011
pappso::specpeptidoms::SemiGlobalAlignment::postProcessingAlign
void postProcessingAlign(const SpOMSSpectrum &spectrum, const SpOMSProtein *protein_ptr, std::size_t beginning, std::size_t length, const std::vector< double > &shifts)
performs the post-processing : generates corrected spectra and align them
Definition semiglobalalignment.cpp:364
pappso::specpeptidoms::SemiGlobalAlignment::preciseAlign
void preciseAlign(const SpOMSSpectrum &spectrum, const SpOMSProtein *protein_ptr, const std::size_t beginning, const std::size_t length)
performs the second alignment search between a protein subsequence and a spectrum.
Definition semiglobalalignment.cpp:170
pappso::specpeptidoms::SemiGlobalAlignment::fastAlign
void fastAlign(const SpOMSSpectrum &spectrum, const SpOMSProtein *protein_ptr)
perform the first alignment search between a protein sequence and a spectrum. The member location hea...
Definition semiglobalalignment.cpp:103
pappso::specpeptidoms::SemiGlobalAlignment::checkSequenceDiversity
static bool checkSequenceDiversity(const QString &sequence, std::size_t window, std::size_t minimum_aa_diversity)
check that the sequence has a minimum of amino acid checkSequenceDiversity
Definition semiglobalalignment.cpp:1062
pappso::specpeptidoms::SemiGlobalAlignment::getPotentialMassErrors
static std::vector< double > getPotentialMassErrors(const pappso::AaCode &aa_code, const Alignment &alignment, const QString &protein_seq)
Returns a list of the potential mass errors corresponding to the provided alignment in the provided p...
Definition semiglobalalignment.cpp:1017
pappso::specpeptidoms::SemiGlobalAlignment::getLocationSaver
LocationSaver getLocationSaver() const
Returns a copy of m_location_saver.
Definition semiglobalalignment.cpp:809
pappso::specpeptidoms::SpOMSProtein
Definition spomsprotein.h:38
pappso::specpeptidoms::SpOMSProtein::getSequence
const QString & getSequence() const
Definition spomsprotein.cpp:58
pappso::specpeptidoms::SpOMSProtein::getAccession
const QString getAccession() const
Definition spomsprotein.cpp:52
exceptionoutofrange.h
filterchargedeconvolution.h
filterpass.h
filterresample.h
pappso::cbor::psm
Definition cborscanmapbase.h:40
pappso::specpeptidoms::SpOMSSpectrumCsp
std::shared_ptr< const SpOMSSpectrum > SpOMSSpectrumCsp
Definition spomsspectrum.h:66
pappso::QualifiedMassSpectrumSPtr
std::shared_ptr< QualifiedMassSpectrum > QualifiedMassSpectrumSPtr
Definition qualifiedmassspectrum.h:43
pappso::PeptideIonNter::a
@ a
Definition peptide.h:77
pappso::PeptideIonNter::b
@ b
Definition peptide.h:74
pappso::PeptideSp
std::shared_ptr< const Peptide > PeptideSp
Definition aamodification.h:48
pappso::PrecisionPtr
const PrecisionBase * PrecisionPtr
Definition precision.h:122
pappsoexception.h
peptideproformaparser.h
psmcborutils.h
psmspecpeptidoms.h
spomsspectrum.h
pappso::cbor::psm::PsmProtein
Definition psmproteinmap.h:46
pappso::cbor::psm::PsmProtein::isTarget
bool isTarget
Definition psmproteinmap.h:48
pappso::cbor::psm::PsmProtein::protein_sp
std::shared_ptr< Protein > protein_sp
Definition psmproteinmap.h:47
pappso::specpeptidoms::Alignment
Definition semiglobalalignment.h:57
pappso::specpeptidoms::Alignment::SPC
std::size_t SPC
Definition semiglobalalignment.h:86
pappso::specpeptidoms::Alignment::getNonAlignedMass
double getNonAlignedMass() const
convenient function to get the remaining non explained mass shift
Definition semiglobalalignment.cpp:66
pappso::specpeptidoms::Alignment::shifts
std::vector< double > shifts
Definition semiglobalalignment.h:85
pappso::specpeptidoms::Alignment::end
std::size_t end
Definition semiglobalalignment.h:88
pappso::specpeptidoms::Alignment::end_shift
double end_shift
Definition semiglobalalignment.h:83
pappso::specpeptidoms::Alignment::score
int score
Definition semiglobalalignment.h:80
pappso::specpeptidoms::Alignment::getPositionStart
std::size_t getPositionStart() const
get position of start on the protein sequence
Definition semiglobalalignment.cpp:74
pappso::specpeptidoms::Alignment::m_peptideModel
PeptideModel m_peptideModel
Definition semiglobalalignment.h:78
pappso::specpeptidoms::Alignment::begin_shift
double begin_shift
Definition semiglobalalignment.h:81