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

`#include <psmfeaturesscan.h>`

Inheritance diagram for pappso::cbor::psm::PsmFeaturesScan:

## Public Member Functions

| PsmFeaturesScan (const PsmFileScanProcess &psm_file_scan_process, pappso::XtandemSpectrumProcess &tandem_spectrum_process, std::list< pappso::Enums::PeptideIon > &ion_list, pappso::PsmFeatures &psm_features, pappso::PrecisionPtr fragment_tolerance)
virtual | ~PsmFeaturesScan ()
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
double | checkInf (double input) const
Protected Member Functions inherited from pappso::cbor::psm::CborScanMapBase
pappso::QualifiedMassSpectrumSPtr | getCurrentQualifiedMassSpectrumSPtr () const

## Private Attributes

pappso::XtandemSpectrumProcess & | m_tandemSpectrumProcess
std::list< pappso::Enums::PeptideIon > & | m_ionList
pappso::PsmFeatures | m_psmFeatures
pappso::PrecisionPtr | m_fragmentTolerance

## Additional Inherited Members

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

## Detailed Description

Todo
  write docs

Definition at line 44 of file psmfeaturesscan.h.

## Constructor & Destructor Documentation

## PsmFeaturesScan()

pappso::cbor::psm::PsmFeaturesScan::PsmFeaturesScan | ( | const PsmFileScanProcess & | psm_file_scan_process,
|  | pappso::XtandemSpectrumProcess & | tandem_spectrum_process,
|  | std::list< pappso::Enums::PeptideIon > & | ion_list,
|  | pappso::PsmFeatures & | psm_features,
|  | pappso::PrecisionPtr | fragment_tolerance )

Default constructor

Definition at line 42 of file psmfeaturesscan.cpp.

: CborScanMapBase(psm_file_scan_process),
m_tandemSpectrumProcess(tandem_spectrum_process),
m_ionList(ion_list),
m_psmFeatures(psm_features)
{
m_fragmentTolerance = fragment_tolerance;
}
pappso::cbor::psm::CborScanMapBase::CborScanMapBase
CborScanMapBase(const PsmFileScanProcess &psm_file_scan_process)
Definition cborscanmapbase.cpp:40
pappso::cbor::psm::PsmFeaturesScan::m_tandemSpectrumProcess
pappso::XtandemSpectrumProcess & m_tandemSpectrumProcess
Definition psmfeaturesscan.h:66
pappso::cbor::psm::PsmFeaturesScan::m_ionList
std::list< pappso::Enums::PeptideIon > & m_ionList
Definition psmfeaturesscan.h:67
pappso::cbor::psm::PsmFeaturesScan::m_fragmentTolerance
pappso::PrecisionPtr m_fragmentTolerance
Definition psmfeaturesscan.h:69
pappso::cbor::psm::PsmFeaturesScan::m_psmFeatures
pappso::PsmFeatures m_psmFeatures
Definition psmfeaturesscan.h:68

References pappso::cbor::psm::CborScanMapBase::CborScanMapBase(), m_fragmentTolerance, m_ionList, m_psmFeatures, and m_tandemSpectrumProcess.

## ~PsmFeaturesScan()

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

virtual

Destructor

Definition at line 55 of file psmfeaturesscan.cpp.

{
}

## Member Function Documentation

## checkInf()

double pappso::cbor::psm::PsmFeaturesScan::checkInf | ( | double | input | ) | const

protected

Definition at line 60 of file psmfeaturesscan.cpp.

{
if(input < 0)
return 0;
return input;
}

Referenced by process().

## process()

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

override protected virtual

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

Definition at line 68 of file psmfeaturesscan.cpp.

{
if(keys().contains("psm_list"))
{
QualifiedMassSpectrumSPtr qualified_mass_spectrum = getCurrentQualifiedMassSpectrumSPtr();
pappso::MassSpectrum spectrum =
m_tandemSpectrumProcess.process(*qualified_mass_spectrum.get()->getMassSpectrumSPtr().get(),
qualified_mass_spectrum.get()->getPrecursorMz(),
qualified_mass_spectrum.get()->getPrecursorCharge());
// qWarning() << qualified_mass_spectrum.get()->getMassSpectrumId().getSpectrumIndex();
QCborArray new_psm_arr;
for(QCborValue cbor_psm : value("psm_list").toArray())
{
QCborMap cbor_psm_map = cbor_psm.toMap();
QCborMap cbor_psm_features;
pappso::PeptideSp peptide_sp =
pappso::PeptideProFormaParser::parseString(cbor_psm_map.value("proforma").toString());
if(peptide_sp.get()->size() < 2)
{
throw pappso::PappsoException(QObject::tr("peptide in psm too small %1")
.arg(cbor_psm_map.value("proforma").toString()));
}
// qWarning() << cbor_psm_map.value("proforma").toString() << "end " <<
// qualified_mass_spectrum.get()->getMassSpectrumId().getSpectrumIndex();
std::size_t peptide_size = peptide_sp.get()->size();
cbor_psm_features.insert(QString("peptide_size"), (unsigned int)peptide_size);
pappso::XtandemHyperscore hyperscore(spectrum,
peptide_sp,
qualified_mass_spectrum.get()->getPrecursorCharge(),
m_fragmentTolerance,
m_ionList,
true);
cbor_psm_features.insert(QString("hyperscore"), QCborValue(hyperscore.getHyperscore()));
// qWarning() << cbor_psm_map.value("proforma").toString() << "end2 " <<
// qualified_mass_spectrum.get()->getMassSpectrumId().getSpectrumIndex();
m_psmFeatures.setPeptideSpectrumCharge(
peptide_sp,
qualified_mass_spectrum.get()->getMassSpectrumSPtr().get(),
qualified_mass_spectrum.get()->getPrecursorCharge(),
2);
// TIC
cbor_psm_features.insert(QString("total_intensity"),
std::log(m_psmFeatures.getTotalIntensity()));
// MaxIntALL
cbor_psm_features.insert(QString("max_intensity"),
checkInf(std::log(qualified_mass_spectrum.get()
->getMassSpectrumSPtr()
.get()
->maxIntensityDataPoint()
.y)));
// qWarning() << cbor_psm_map.value("proforma").toString() << "end3 " <<
// qualified_mass_spectrum.get()->getMassSpectrumId().getSpectrumIndex();
// MaxYionInt
cbor_psm_features.insert(
QString("MaxYionInt"),
checkInf(std::log(m_psmFeatures.getMaxIntensityPeakIonMatch(Enums::PeptideIon::y))));
// MaxBionInt
cbor_psm_features.insert(
QString("MaxBionInt"),
checkInf(std::log(m_psmFeatures.getMaxIntensityPeakIonMatch(Enums::PeptideIon::b))));
// SumYmatchInt
cbor_psm_features.insert(
QString("SumYmatchInt"),
checkInf(std::log(m_psmFeatures.getIntensityOfMatchedIon(Enums::PeptideIon::y))));
// SumBmatchInt
cbor_psm_features.insert(
QString("SumBmatchInt"),
checkInf(std::log(m_psmFeatures.getIntensityOfMatchedIon(Enums::PeptideIon::b))));
// FracYmatchInt
cbor_psm_features.insert(
QString("FracYmatchInt"),
checkInf(m_psmFeatures.getIntensityOfMatchedIon(Enums::PeptideIon::y) /
m_psmFeatures.getTotalIntensity()));
// FracBmatchInt
cbor_psm_features.insert(
QString("FracBmatchInt"),
checkInf(m_psmFeatures.getIntensityOfMatchedIon(Enums::PeptideIon::b) /
m_psmFeatures.getTotalIntensity()));
// SeqCoverYion
cbor_psm_features.insert(
QString("SeqCoverYion"),
(double)m_psmFeatures.getAaSequenceCoverage(Enums::PeptideIon::y) /
(double)peptide_size);
// SeqCoverBion
cbor_psm_features.insert(
QString("SeqCoverBion"),
(double)m_psmFeatures.getAaSequenceCoverage(Enums::PeptideIon::b) /
(double)peptide_size);
// ConsecutiveYion
cbor_psm_features.insert(
QString("ConsecutiveYion"),
(qint64)m_psmFeatures.getMaxConsecutiveIon(Enums::PeptideIon::y));
// ConsecutiveBion
cbor_psm_features.insert(
QString("ConsecutiveBion"),
(qint64)m_psmFeatures.getMaxConsecutiveIon(Enums::PeptideIon::b));
// MassErrMean
cbor_psm_features.insert(QString("MassErrMean"), m_psmFeatures.getMatchedMzDiffMean());
// MassErrSD
cbor_psm_features.insert(QString("MassErrSD"), m_psmFeatures.getMatchedMzDiffSd());
// NumofAnnoPeaks
cbor_psm_features.insert(QString("NumofAnnoPeaks"),
(unsigned int)m_psmFeatures.getNumberOfMatchedIons());
// qWarning() << cbor_psm_map.value("proforma").toString() << "end2 " <<
// qualified_mass_spectrum.get()->getMassSpectrumId().getSpectrumIndex();
// NumofComplementPeaks
std::size_t num_of_pairs = m_psmFeatures.countMatchedIonComplementPairs();
cbor_psm_features.insert(QString("NumofComplementPeaks"), (unsigned int)num_of_pairs);
if(num_of_pairs > 0)
{
// SumComplementPeaksInt
cbor_psm_features.insert(
QString("SumComplementPeaksInt"),
std::log(m_psmFeatures.getTotalIntensityOfMatchedIonComplementPairs()));
// FracComplementPeaksInt
cbor_psm_features.insert(
QString("FracComplementPeaksInt"),
m_psmFeatures.getTotalIntensityOfMatchedIonComplementPairs() /
m_psmFeatures.getTotalIntensity());
// SeqCoverComplementPeaks
cbor_psm_features.insert(
QString("SeqCoverComplementPeaks"),
(double)m_psmFeatures.getComplementPairsAaSequenceCoverage() /
(double)peptide_size);
}
pappso::LinearRegression lr = m_psmFeatures.getIonIsotopeLinearRegression();
cbor_psm_features.insert(QString("lrSize"), (unsigned int)lr.getSize());
double coeff_of_determination = lr.getCoefficientOfDetermination();
if(std::isnan(coeff_of_determination))
{
}
else
{
cbor_psm_features.insert(QString("lrCoeffDet"), coeff_of_determination);
}
QCborMap psm_eval = cbor_psm_map.value("eval").toMap();
psm_eval.remove(QString("features"));
psm_eval.insert(QString("features"), cbor_psm_features);
cbor_psm_map.remove(QString("eval"));
cbor_psm_map.insert(QString("eval"), psm_eval);
new_psm_arr.push_back(cbor_psm_map);
}
insert(QString("psm_list"), new_psm_arr);
// qWarning() << "end " <<
// qualified_mass_spectrum.get()->getMassSpectrumId().getSpectrumIndex();
}
}
pappso::LinearRegression::getSize
std::size_t getSize() const
get data size
Definition linearregression.cpp:67
pappso::LinearRegression::getCoefficientOfDetermination
double getCoefficientOfDetermination() const
get Coefficient of determination (R2)
Definition linearregression.cpp:115
pappso::PeptideProFormaParser::parseString
static PeptideSp parseString(const QString &pepstr)
Definition peptideproformaparser.cpp:228
pappso::cbor::psm::CborScanMapBase::getCurrentQualifiedMassSpectrumSPtr
pappso::QualifiedMassSpectrumSPtr getCurrentQualifiedMassSpectrumSPtr() const
Definition cborscanmapbase.cpp:136
pappso::cbor::psm::PsmFeaturesScan::checkInf
double checkInf(double input) const
Definition psmfeaturesscan.cpp:60
pappso::Enums::PeptideIon::y
@ y
Cter amino ions.
Definition types.h:295
pappso::Enums::PeptideIon::b
@ b
Nter acylium ions.
Definition types.h:287
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::Enums::b, checkInf(), pappso::LinearRegression::getCoefficientOfDetermination(), pappso::cbor::psm::CborScanMapBase::getCurrentQualifiedMassSpectrumSPtr(), pappso::XtandemHyperscore::getHyperscore(), pappso::LinearRegression::getSize(), m_fragmentTolerance, m_ionList, m_psmFeatures, m_tandemSpectrumProcess, pappso::PeptideProFormaParser::parseString(), and pappso::Enums::y.

## Member Data Documentation

## m_fragmentTolerance

pappso::PrecisionPtr pappso::cbor::psm::PsmFeaturesScan::m_fragmentTolerance

private

Definition at line 69 of file psmfeaturesscan.h.

Referenced by PsmFeaturesScan(), and process().

## m_ionList

std::list<pappso::Enums::PeptideIon>& pappso::cbor::psm::PsmFeaturesScan::m_ionList

private

Definition at line 67 of file psmfeaturesscan.h.

Referenced by PsmFeaturesScan(), and process().

## m_psmFeatures

pappso::PsmFeatures pappso::cbor::psm::PsmFeaturesScan::m_psmFeatures

private

Definition at line 68 of file psmfeaturesscan.h.

Referenced by PsmFeaturesScan(), and process().

## m_tandemSpectrumProcess

pappso::XtandemSpectrumProcess& pappso::cbor::psm::PsmFeaturesScan::m_tandemSpectrumProcess

private

Definition at line 66 of file psmfeaturesscan.h.

Referenced by PsmFeaturesScan(), and process().

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

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