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

`#include <psmionseries.h>`

Inheritance diagram for pappso::cbor::psm::PsmIonSeriesScan:

## Public Member Functions

| PsmIonSeriesScan (const PsmIonSeries &psm_specpeptidoms, pappso::PrecisionPtr fragment_tolerance)
virtual | ~PsmIonSeriesScan ()
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 PsmIonSeries * | mp_psmSpecPeptidOms
pappso::PrecisionPtr | m_fragmentTolerance

## Additional Inherited Members

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

## Detailed Description

Definition at line 73 of file psmionseries.h.

## Constructor & Destructor Documentation

## PsmIonSeriesScan()

pappso::cbor::psm::PsmIonSeriesScan::PsmIonSeriesScan | ( | const PsmIonSeries & | psm_specpeptidoms,
|  | pappso::PrecisionPtr | fragment_tolerance )

Default constructor

Definition at line 84 of file psmionseries.cpp.

: CborScanMapBase(psm_specpeptidoms)
{
m_fragmentTolerance = fragment_tolerance;
mp_psmSpecPeptidOms = &psm_specpeptidoms;
}
pappso::cbor::psm::CborScanMapBase::CborScanMapBase
CborScanMapBase(const PsmFileScanProcess &psm_file_scan_process)
Definition cborscanmapbase.cpp:40
pappso::cbor::psm::PsmIonSeriesScan::mp_psmSpecPeptidOms
const PsmIonSeries * mp_psmSpecPeptidOms
Definition psmionseries.h:90
pappso::cbor::psm::PsmIonSeriesScan::m_fragmentTolerance
pappso::PrecisionPtr m_fragmentTolerance
Definition psmionseries.h:91

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

## ~PsmIonSeriesScan()

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

virtual

Destructor

Definition at line 92 of file psmionseries.cpp.

{
}

## Member Function Documentation

## process()

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

override protected virtual

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

Definition at line 97 of file psmionseries.cpp.

{
// qWarning() <<"PsmIonSeriesScan::process" << keys();
if(!keys().contains("id"))
{
throw pappso::PappsoException(QObject::tr("missing scan id"));
}
if(keys().contains("psm_list"))
{
QualifiedMassSpectrumSPtr qualified_mass_spectrum = getCurrentQualifiedMassSpectrumSPtr();
int precursor_charge = qualified_mass_spectrum.get()->getPrecursorCharge();
QCborArray new_psm_arr;
for(QCborValue cbor_psm : value("psm_list").toArray())
{
QCborMap cbor_psm_map = cbor_psm.toMap();
qDebug() << "PsmIonSeriesScan::process cbor_psm_map.keys() " << cbor_psm_map.keys();
if(!cbor_psm_map.keys().contains("proforma"))
{
throw pappso::PappsoException(
QObject::tr("missing proforma in psm %1").arg(cbor_psm_map.keys().size()));
}
pappso::PeptideSp peptide_sp =
pappso::PeptideProFormaParser::parseString(cbor_psm_map.value("proforma").toString());
qDebug() << peptide_sp.get()->toString();
pappso::PeptideIsotopeSpectrumMatch psm(
*(qualified_mass_spectrum.get()->getMassSpectrumSPtr().get()),
peptide_sp,
precursor_charge,
m_fragmentTolerance,
pappso::PeptideFragmentIonListBase::getCIDionList(),
2,
0);
struct data_plot
{
pappso::DataPoint point;
double mz_th;
int charge;
int size;
int isotope_number;
int isotope_rank;
};
std::map<pappso::Enums::PeptideIon, std::vector<data_plot>> ion_map;
for(const pappso::PeakIonIsotopeMatch &peakion_match : psm)
{
data_plot one_ion_match;
one_ion_match.charge = (int)peakion_match.getCharge();
one_ion_match.isotope_number =
(int)peakion_match.getPeptideNaturalIsotopeAverageSp().get()->getIsotopeNumber();
one_ion_match.isotope_rank =
(int)peakion_match.getPeptideNaturalIsotopeAverageSp().get()->getIsotopeRank();
one_ion_match.mz_th =
peakion_match.getPeptideNaturalIsotopeAverageSp().get()->getMz();
one_ion_match.point = peakion_match.getPeak();
one_ion_match.size = (int)peakion_match.getPeptideFragmentIonSp().get()->size();
auto it = ion_map.insert({peakion_match.getPeptideIonType(), {}});
it.first->second.push_back(one_ion_match);
}
QCborMap cbor_psm_props_peptide;
cbor_psm_props_peptide.insert(QString("mz"), peptide_sp.get()->getMz(precursor_charge));
cbor_psm_props_peptide.insert(QString("mh"), peptide_sp.get()->getMz(1));
QCborMap cbor_psm_props_ion_series;
for(auto &cle_valeur : ion_map)
{
std::vector<data_plot> &current_vector = cle_valeur.second;
std::sort(
current_vector.begin(),
current_vector.end(),
[](const data_plot &a, const data_plot &b) { return a.point.x < b.point.x; });
QCborArray current_ion_json_arr;
for(const data_plot &one_point : current_vector)
{
QCborMap current_ion;
current_ion.insert(QString("mz"), one_point.point.x);
current_ion.insert(QString("mzth"), one_point.mz_th);
current_ion.insert(QString("intensity"), one_point.point.y);
current_ion.insert(QString("size"), one_point.size);
current_ion.insert(QString("charge"), one_point.charge);
current_ion.insert(QString("isotope"), one_point.isotope_number);
current_ion.insert(QString("rank"), one_point.isotope_rank);
current_ion_json_arr.push_back(current_ion);
}
cbor_psm_props_ion_series.insert(pappso::Utils::toString(cle_valeur.first),
current_ion_json_arr);
}
QCborMap cbor_psm_props;
if(cbor_psm_map.keys().contains("props"))
{
cbor_psm_props = cbor_psm_map.value("props").toMap();
}
cbor_psm_props.remove(QString("peptide"));
cbor_psm_props.insert(QString("peptide"), cbor_psm_props_peptide);
cbor_psm_props.remove(QString("ion-series"));
cbor_psm_props.insert(QString("ion-series"), cbor_psm_props_ion_series);
cbor_psm_map.remove(QString("props"));
cbor_psm_map.insert(QString("props"), cbor_psm_props);
QCborValue copy_eval = cbor_psm_map.value("eval");
cbor_psm_map.remove(QString("eval"));
cbor_psm_map.insert(QString("eval"), copy_eval);
qDebug() << "PsmIonSeriesScan::process cbor_psm_map.keys() " << cbor_psm_map.keys();
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);
}
}
pappso::PeptideFragmentIonListBase::getCIDionList
static std::list< Enums::PeptideIon > getCIDionList()
Definition peptidefragmentionlistbase.cpp:41
pappso::PeptideProFormaParser::parseString
static PeptideSp parseString(const QString &pepstr)
Definition peptideproformaparser.cpp:228
pappso::Utils::toString
static QString toString(specglob::SpectralAlignmentType type)
Convenience function to return a string describing the specglob alingment type.
Definition utils.cpp:544
pappso::cbor::psm::CborScanMapBase::getCurrentQualifiedMassSpectrumSPtr
pappso::QualifiedMassSpectrumSPtr getCurrentQualifiedMassSpectrumSPtr() const
Definition cborscanmapbase.cpp:136
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

References pappso::a, pappso::b, pappso::PeptideFragmentIonListBase::getCIDionList(), pappso::cbor::psm::CborScanMapBase::getCurrentQualifiedMassSpectrumSPtr(), m_fragmentTolerance, pappso::PeptideProFormaParser::parseString(), and pappso::Utils::toString().

## Member Data Documentation

## m_fragmentTolerance

pappso::PrecisionPtr pappso::cbor::psm::PsmIonSeriesScan::m_fragmentTolerance

private

Definition at line 91 of file psmionseries.h.

Referenced by PsmIonSeriesScan(), and process().

## mp_psmSpecPeptidOms

const PsmIonSeries* pappso::cbor::psm::PsmIonSeriesScan::mp_psmSpecPeptidOms

private

Definition at line 90 of file psmionseries.h.

Referenced by PsmIonSeriesScan().

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

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