Loading...
Searching...
No Matches
pappso::cbor::psm::PsmSpecGlobScan Class Reference

`#include <psmspecglobscan.h>`

Inheritance diagram for pappso::cbor::psm::PsmSpecGlobScan:

## Public Member Functions

| PsmSpecGlobScan (const PsmSpecGlob &psm_specgloc, pappso::PrecisionPtr fragment_tolerance)
virtual | ~PsmSpecGlobScan ()
Public Member Functions inherited from pappso::cbor::psm::CborScanMapBase
| CborScanMapBase (const PsmFileScanProcess &psm_file_scan_process)
virtual | ~CborScanMapBase ()
virtual void | filterAndSortPsmList ()
void | filterPsmListUniqueUniqueProforma ()
std::vector< double >::iterator | addPsmEvalVectorDouble (const QString &eval_name, const QString &eval_value_key, std::vector< double >::iterator begin, std::vector< double >::const_iterator end)
| add a new eval key and double values (from a vector) to each PSM
QCborMap | getCborScanId () const
QCborMap | getCborScanPrecursor () const
QCborArray | getCborPsmList () const
void | populateProteinMapUsingOldProteinMap (const PsmProteinMap &old_protein_map, PsmProteinMap &new_protein_map) const

## Protected Member Functions

void | process () override
Protected Member Functions inherited from pappso::cbor::psm::CborScanMapBase
pappso::QualifiedMassSpectrumSPtr | getCurrentQualifiedMassSpectrumSPtr () const

## Private Attributes

const PsmSpecGlob * | mp_psmSpecGlob
pappso::PrecisionPtr | m_fragmentTolerance
bool | m_checkMutations = false

## Additional Inherited Members

Protected Attributes inherited from pappso::cbor::psm::CborScanMapBase
const PsmFileScanProcess & | m_PsmFileScanProcess

## Detailed Description

Todo
  write docs

Definition at line 37 of file psmspecglobscan.h.

## Constructor & Destructor Documentation

## PsmSpecGlobScan()

pappso::cbor::psm::PsmSpecGlobScan::PsmSpecGlobScan | ( | const PsmSpecGlob & | psm_specgloc,
|  | pappso::PrecisionPtr | fragment_tolerance )

Default constructor

Definition at line 35 of file psmspecglobscan.cpp.

: CborScanMapBase(psm_specgloc)
{
m_fragmentTolerance = fragment_tolerance;
mp_psmSpecGlob = &psm_specgloc;
}
pappso::cbor::psm::CborScanMapBase::CborScanMapBase
CborScanMapBase(const PsmFileScanProcess &psm_file_scan_process)
Definition cborscanmapbase.cpp:40
pappso::cbor::psm::PsmSpecGlobScan::m_fragmentTolerance
pappso::PrecisionPtr m_fragmentTolerance
Definition psmspecglobscan.h:56
pappso::cbor::psm::PsmSpecGlobScan::mp_psmSpecGlob
const PsmSpecGlob * mp_psmSpecGlob
Definition psmspecglobscan.h:55

References pappso::cbor::psm::CborScanMapBase::CborScanMapBase(), m_fragmentTolerance, and mp_psmSpecGlob.

## ~PsmSpecGlobScan()

pappso::cbor::psm::PsmSpecGlobScan::~PsmSpecGlobScan | ( |  | ) |

virtual

Destructor

Definition at line 43 of file psmspecglobscan.cpp.

{
}

## Member Function Documentation

## process()

void pappso::cbor::psm::PsmSpecGlobScan::process | ( |  | ) |

override protected virtual

Reimplemented from pappso::cbor::psm::CborScanMapBase.

Definition at line 48 of file psmspecglobscan.cpp.

{
if(!keys().contains("id"))
{
throw pappso::PappsoException(QObject::tr("missing scan id"));
}
if(keys().contains("psm_list"))
{
QualifiedMassSpectrumSPtr qualified_mass_spectrum = getCurrentQualifiedMassSpectrumSPtr();
pappso::specglob::ExperimentalSpectrumCsp experimental_spectrum =
std::make_shared<pappso::specglob::ExperimentalSpectrum>(*qualified_mass_spectrum.get(),
m_fragmentTolerance);
mp_psmSpecGlob->filterMassSpectrum(
*(qualified_mass_spectrum.get()->getMassSpectrumSPtr().get()));
QCborArray new_psm_arr;
for(QCborValue cbor_psm : value("psm_list").toArray())
{
QCborMap cbor_psm_map = cbor_psm.toMap();
if(!cbor_psm_map.keys().contains("proforma"))
{
throw pappso::PappsoException(
QObject::tr("missing proforma in psm %1 spectrum %2")
.arg(cbor_psm_map.keys().size())
.arg(qualified_mass_spectrum.get()->getMassSpectrumId().getNativeId()));
}
QString proforma = cbor_psm_map.value("proforma").toString();
if(proforma.isEmpty())
{
throw pappso::PappsoException(
QObject::tr("proforma is empty in psm %1 spectrum %2")
.arg(cbor_psm_map.keys().size())
.arg(qualified_mass_spectrum.get()->getMassSpectrumId().getNativeId()));
}
QCborMap cbor_psm_eval_specglob;
qDebug();
pappso::PeptideSp peptide_sp = pappso::PeptideProFormaParser::parseString(proforma);
qDebug() << proforma << " " << peptide_sp.get()->toProForma();
pappso::specglob::PeptideSpectraCsp peptide_spectra =
std::make_shared<pappso::specglob::PeptideSpectrum>(peptide_sp);
qDebug();
qDebug();
pappso::specglob::SpectralAlignment spectral_alignment(pappso::specglob::ScoreValues(),
m_fragmentTolerance);
spectral_alignment.align(peptide_spectra, experimental_spectrum);
cbor_psm_eval_specglob.insert(QString("max_score"), spectral_alignment.getMaxScore());
bool keep = false;
if(spectral_alignment.getMaxScore() > 0)
{
pappso::specglob::PeptideModel peptide_model = spectral_alignment.buildPeptideModel();
// peptide_model.eliminateComplementaryDelta(m_fragmentTolerance);
// peptide_model.matchExperimentalPeaks(m_fragmentTolerance);
pappso::specglob::PostTreatment post_treatment(m_fragmentTolerance, peptide_model);
if(m_checkMutations)
post_treatment.findReplaceMutations();
peptide_model = post_treatment.getBetterPeptideModel();
cbor_psm_eval_specglob.insert(QString("count"),
(qint64)peptide_model.getCountSharedPeaks());
cbor_psm_eval_specglob.insert(QString("proforma"), peptide_model.toProForma());
cbor_psm_eval_specglob.insert(QString("bracket"), peptide_model.toString());
// peptide_model.checkForMutations()
if(mp_psmSpecGlob->m_isProteinMatcherResult)
{
keep = true;
}
}
QCborMap psm_eval = cbor_psm_map.value("eval").toMap();
psm_eval.remove(QString("specglob"));
psm_eval.insert(QString("specglob"), cbor_psm_eval_specglob);
cbor_psm_map.remove(QString("eval"));
cbor_psm_map.insert(QString("eval"), psm_eval);
if(mp_psmSpecGlob->m_isProteinMatcherResult)
{
if(keep)
{
QCborMap new_psm;
new_psm.insert(QString("proforma"),
cbor_psm_eval_specglob.value("proforma").toString());
new_psm.insert(QString("protein_list"), cbor_psm_map.value("protein_list"));
new_psm.insert(QString("eval"), cbor_psm_map.value("eval"));
new_psm_arr.push_back(new_psm);
}
}
else
{
new_psm_arr.push_back(cbor_psm_map);
}
}
// insert(QString("psm_list"), new_psm_arr);
remove(QString("psm_list"));
insert(QString("psm_list"), new_psm_arr);
filterPsmListUniqueUniqueProforma();
}
}
pappso::PeptideProFormaParser::parseString
static PeptideSp parseString(const QString &pepstr)
Definition peptideproformaparser.cpp:228
pappso::cbor::psm::CborScanMapBase::filterPsmListUniqueUniqueProforma
void filterPsmListUniqueUniqueProforma()
Definition cborscanmapbase.cpp:268
pappso::cbor::psm::CborScanMapBase::getCurrentQualifiedMassSpectrumSPtr
pappso::QualifiedMassSpectrumSPtr getCurrentQualifiedMassSpectrumSPtr() const
Definition cborscanmapbase.cpp:136
pappso::cbor::psm::PsmSpecGlobScan::m_checkMutations
bool m_checkMutations
Definition psmspecglobscan.h:57
pappso::specglob::PeptideModel::getCountSharedPeaks
std::size_t getCountSharedPeaks() const
Definition peptidemodel.cpp:440
pappso::specglob::PeptideModel::toProForma
QString toProForma() const
get the peptide model in ProForma notation https://github.com/HUPO-PSI/ProForma/blob/master/README....
Definition peptidemodel.cpp:213
pappso::specglob::PeptideModel::toString
QString toString() const
Definition peptidemodel.cpp:128
pappso::specglob::PeptideSpectraCsp
std::shared_ptr< const PeptideSpectrum > PeptideSpectraCsp
Definition peptidespectrum.h:58
pappso::specglob::ExperimentalSpectrumCsp
std::shared_ptr< const ExperimentalSpectrum > ExperimentalSpectrumCsp
Definition experimentalspectrum.h:59
pappso::QualifiedMassSpectrumSPtr
std::shared_ptr< QualifiedMassSpectrum > QualifiedMassSpectrumSPtr
Definition qualifiedmassspectrum.h:43
pappso::PeptideSp
std::shared_ptr< const Peptide > PeptideSp
Definition aamodification.h:48

References pappso::specglob::SpectralAlignment::align(), pappso::specglob::SpectralAlignment::buildPeptideModel(), pappso::cbor::psm::CborScanMapBase::filterPsmListUniqueUniqueProforma(), pappso::specglob::PostTreatment::findReplaceMutations(), pappso::specglob::PostTreatment::getBetterPeptideModel(), pappso::specglob::PeptideModel::getCountSharedPeaks(), pappso::cbor::psm::CborScanMapBase::getCurrentQualifiedMassSpectrumSPtr(), pappso::specglob::SpectralAlignment::getMaxScore(), m_checkMutations, m_fragmentTolerance, mp_psmSpecGlob, pappso::PeptideProFormaParser::parseString(), pappso::specglob::PeptideModel::toProForma(), and pappso::specglob::PeptideModel::toString().

## Member Data Documentation

## m_checkMutations

bool pappso::cbor::psm::PsmSpecGlobScan::m_checkMutations = false

private

Definition at line 57 of file psmspecglobscan.h.

Referenced by process().

## m_fragmentTolerance

pappso::PrecisionPtr pappso::cbor::psm::PsmSpecGlobScan::m_fragmentTolerance

private

Definition at line 56 of file psmspecglobscan.h.

Referenced by PsmSpecGlobScan(), and process().

## mp_psmSpecGlob

const PsmSpecGlob* pappso::cbor::psm::PsmSpecGlobScan::mp_psmSpecGlob

private

Definition at line 55 of file psmspecglobscan.h.

Referenced by PsmSpecGlobScan(), and process().

The documentation for this class was generated from the following files:

- pappsomspp/core/processing/cbor/psm/evalscan/psmspecglobscan.h
- pappsomspp/core/processing/cbor/psm/evalscan/psmspecglobscan.cpp