Loading...
Searching...
No Matches
pappso::cbor::psm::PsmFileScanProcess Class Referenceabstract

Basic PSM file reader to process scan (parallelized scan processing). More...

`#include <psmfilescanprocess.h>`

Inheritance diagram for pappso::cbor::psm::PsmFileScanProcess:

## Public Member Functions

| PsmFileScanProcess (std::size_t buffer_scan_size)
virtual | ~PsmFileScanProcess ()
Public Member Functions inherited from pappso::cbor::psm::PsmFileReaderBase
| PsmFileReaderBase ()
virtual | ~PsmFileReaderBase () override
void | readCbor (QFile *cborp, pappso::UiMonitorInterface &monitor)
void | readCbor (QIODevice *cborp, pappso::UiMonitorInterface &monitor)
Public Member Functions inherited from pappso::cbor::CborStreamReaderInterface
| CborStreamReaderInterface ()
virtual | ~CborStreamReaderInterface ()
virtual void | close ()
| convenient function to clean pointer before leaving

## Protected Member Functions

void | readScan (pappso::UiMonitorInterface &monitor) override
void | scanFinished (pappso::UiMonitorInterface &monitor) override
void | sampleFinished (pappso::UiMonitorInterface &monitor) override
virtual void | processBufferScan (pappso::UiMonitorInterface &monitor)
virtual void | processBufferScanDone (pappso::UiMonitorInterface &monitor)
virtual CborScanMapBase * | newCborScanMap ()=0
void | clearScanBuffer ()
Protected Member Functions inherited from pappso::cbor::psm::PsmFileReaderBase
void | readRoot (pappso::UiMonitorInterface &monitor)
virtual void | readInformations (pappso::UiMonitorInterface &monitor)
virtual void | readLog (pappso::UiMonitorInterface &monitor)
virtual void | readParameterMap (pappso::UiMonitorInterface &monitor)
virtual void | readProteinMap (pappso::UiMonitorInterface &monitor)
virtual void | readSample (pappso::UiMonitorInterface &monitor)
virtual void | readPsm (pappso::UiMonitorInterface &monitor)
virtual void | psmReady (pappso::UiMonitorInterface &monitor)
virtual void | logReady (pappso::UiMonitorInterface &monitor)
virtual void | informationsReady (pappso::UiMonitorInterface &monitor)
virtual void | parameterMapReady (pappso::UiMonitorInterface &monitor)
virtual void | fastaFilesReady (pappso::UiMonitorInterface &monitor)
virtual void | proteinMapReady (pappso::UiMonitorInterface &monitor)
virtual void | sampleListStarted (pappso::UiMonitorInterface &monitor)
virtual void | sampleStarted (pappso::UiMonitorInterface &monitor)
virtual void | scanStarted (pappso::UiMonitorInterface &monitor)
virtual void | sampleListFinished (pappso::UiMonitorInterface &monitor)
PsmFile | readPsmFile (bool &is_ok)
void | writePsmFile (CborStreamWriter &writer, const PsmFile &psm_file)
void | writePsmFileList (CborStreamWriter &writer, const std::vector< PsmFile > &file_list)
PsmProteinRef | readPsmProteinRef (bool &is_ok)
pappso::PeptideSp | getCurrentPsmPeptideSp () const
pappso::QualifiedMassSpectrumSPtr | getCurrentQualifiedMassSpectrumSPtr () const
| get the qualified Spectrum for the current PSM
bool | currentProteinRefListContainsDecoy () const
| tells if the current PSM has a decoy accession
bool | currentProteinRefListContainsTarget () const
| tells if the current PSM has a target accession
double | getPrecursorMass (double mz_prec, uint charge) const
| convenient function do compute precusor ion mass
Protected Member Functions inherited from pappso::cbor::CborStreamReaderInterface
bool | getExpectedString ()
void | initCborReader (QFile *pcborfile)
void | initCborReader (QIODevice *pcborfile)

## Protected Attributes

std::size_t | m_bufferScanSize = 1000
std::vector< CborScanMapBase * > | m_cborScanList
Protected Attributes inherited from pappso::cbor::psm::PsmFileReaderBase
QStringList | m_targetFastaFiles
QStringList | m_decoyFastaFiles
PsmProteinMap | m_proteinMap
QString | m_currentSampleName
PsmFile | m_currentPeaklistFile
std::vector< PsmFile > | m_currentIdentificationFileList
QCborMap | m_cborInformations
QCborArray | m_cborLog
QCborMap | m_cborParameterMap
QCborMap | m_cborScanId
QCborMap | m_cborScanPrecursor
QCborMap | m_cborScanMs2
QCborMap | m_cborScanProps
QCborMap | m_cborScanPsmEval
QCborMap | m_cborScanPsmProps
QString | m_currentPsmProforma
std::vector< PsmProteinRef > | m_currentPsmProteinRefList
Protected Attributes inherited from pappso::cbor::CborStreamReaderInterface
CborStreamReader * | mpa_cborReader = nullptr
QString | m_expectedString
QByteArray | m_data

## Private Attributes

friend | CborScanMapBase

## Detailed Description

Basic PSM file reader to process scan (parallelized scan processing).

Definition at line 46 of file psmfilescanprocess.h.

## Constructor & Destructor Documentation

## PsmFileScanProcess()

pappso::cbor::psm::PsmFileScanProcess::PsmFileScanProcess | ( | std::size_t | buffer_scan_size | ) |

Default constructor

Definition at line 41 of file psmfilescanprocess.cpp.

{
m_bufferScanSize = buffer_scan_size;
}
pappso::cbor::psm::PsmFileScanProcess::m_bufferScanSize
std::size_t m_bufferScanSize
Definition psmfilescanprocess.h:73

References m_bufferScanSize.

Referenced by pappso::cbor::psm::PsmFileScanProcessAndCopy::PsmFileScanProcessAndCopy().

## ~PsmFileScanProcess()

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

virtual

Destructor

Definition at line 46 of file psmfilescanprocess.cpp.

{
}

## Member Function Documentation

## clearScanBuffer()

void pappso::cbor::psm::PsmFileScanProcess::clearScanBuffer | ( |  | ) |

protected

Definition at line 51 of file psmfilescanprocess.cpp.

{
for(CborScanMapBase *cbor_scan_p : m_cborScanList)
{
delete cbor_scan_p;
}
m_cborScanList.clear();
}
pappso::cbor::psm::PsmFileScanProcess::m_cborScanList
std::vector< CborScanMapBase * > m_cborScanList
Definition psmfilescanprocess.h:74
pappso::cbor::psm::PsmFileScanProcess::CborScanMapBase
friend CborScanMapBase
Definition psmfilescanprocess.h:49

References CborScanMapBase, and m_cborScanList.

Referenced by newCborScanMap(), sampleFinished(), pappso::cbor::psm::PsmFileScanProcessAndCopy::sampleFinished(), and scanFinished().

## newCborScanMap()

virtual CborScanMapBase * pappso::cbor::psm::PsmFileScanProcess::newCborScanMap | ( |  | ) |

protected pure virtual

Implemented in pappso::cbor::psm::PsmFeatures, pappso::cbor::psm::PsmIonSeries, pappso::cbor::psm::PsmNewEval, pappso::cbor::psm::PsmSpecGlob, and pappso::cbor::psm::PsmSpecPeptidOms.

References CborScanMapBase, and clearScanBuffer().

Referenced by readScan().

## processBufferScan()

void pappso::cbor::psm::PsmFileScanProcess::processBufferScan | ( | pappso::UiMonitorInterface & | monitor | ) |

protected virtual

Definition at line 102 of file psmfilescanprocess.cpp.

{
// you decide how to process the list of scans
// monitor.setStatus(
// QObject::tr("PsmFileScanProcess::processBufferScan %1").arg(m_cborScanList.size()));
std::function<void(CborScanMapBase *)> mapProcessCborScan = [](CborScanMapBase *cbor_scan_p) {
cbor_scan_p->process();
};
QFuture<void> res = QtConcurrent::map<std::vector<CborScanMapBase *>::iterator>(
m_cborScanList.begin(), m_cborScanList.end(), mapProcessCborScan);
res.waitForFinished();
processBufferScanDone(monitor);
// monitor.setStatus(
// QObject::tr("PsmFileScanProcess::processBufferScan %1 done").arg(m_cborScanList.size()));
}
pappso::cbor::psm::PsmFileScanProcess::processBufferScanDone
virtual void processBufferScanDone(pappso::UiMonitorInterface &monitor)
Definition psmfilescanprocess.cpp:122
pappso::Enums::PrecisionUnit::res
@ res
Definition types.h:100

References CborScanMapBase, m_cborScanList, and processBufferScanDone().

Referenced by sampleFinished(), pappso::cbor::psm::PsmFileScanProcessAndCopy::sampleFinished(), and scanFinished().

## processBufferScanDone()

void pappso::cbor::psm::PsmFileScanProcess::processBufferScanDone | ( | pappso::UiMonitorInterface & | monitor | ) |

protected virtual

Reimplemented in pappso::cbor::psm::PsmFileScanProcessAndCopy, pappso::cbor::psm::PsmSpecGlob, and pappso::cbor::psm::PsmSpecPeptidOms.

Definition at line 122 of file psmfilescanprocess.cpp.

{
// you decide what to do with processed scans
}

Referenced by processBufferScan().

## readScan()

void pappso::cbor::psm::PsmFileScanProcess::readScan | ( | pappso::UiMonitorInterface & | monitor | ) |

override protected virtual

Reimplemented from pappso::cbor::psm::PsmFileReaderBase.

Definition at line 62 of file psmfilescanprocess.cpp.

{
qDebug();
// auto& ref = elections.emplace_back("Nelson Mandela", "South Africa", 1994);
CborScanMapBase *scan_map_p = newCborScanMap();
m_cborScanList.push_back(scan_map_p);
if(!mpa_cborReader->readCborMap(*scan_map_p))
{
throw pappso::PappsoException(QObject::tr("readCborMap scan failed"));
}
// m_cborScanList.push_back(scan_map);
qDebug() << "scan end";
scanFinished(monitor);
qDebug();
}
pappso::cbor::CborStreamReaderInterface::mpa_cborReader
CborStreamReader * mpa_cborReader
Definition cborstreamreaderinterface.h:68
pappso::cbor::psm::PsmFileScanProcess::scanFinished
void scanFinished(pappso::UiMonitorInterface &monitor) override
Definition psmfilescanprocess.cpp:80
pappso::cbor::psm::PsmFileScanProcess::newCborScanMap
virtual CborScanMapBase * newCborScanMap()=0

References CborScanMapBase, m_cborScanList, pappso::cbor::CborStreamReaderInterface::mpa_cborReader, newCborScanMap(), and scanFinished().

## sampleFinished()

void pappso::cbor::psm::PsmFileScanProcess::sampleFinished | ( | pappso::UiMonitorInterface & | monitor | ) |

override protected virtual

Reimplemented from pappso::cbor::psm::PsmFileReaderBase.

Reimplemented in pappso::cbor::psm::PsmFileScanProcessAndCopy.

Definition at line 93 of file psmfilescanprocess.cpp.

{
// qWarning() << "sampleFinished";
processBufferScan(monitor);
clearScanBuffer();
}
pappso::cbor::psm::PsmFileScanProcess::processBufferScan
virtual void processBufferScan(pappso::UiMonitorInterface &monitor)
Definition psmfilescanprocess.cpp:102
pappso::cbor::psm::PsmFileScanProcess::clearScanBuffer
void clearScanBuffer()
Definition psmfilescanprocess.cpp:51

References clearScanBuffer(), and processBufferScan().

## scanFinished()

void pappso::cbor::psm::PsmFileScanProcess::scanFinished | ( | pappso::UiMonitorInterface & | monitor | ) |

override protected virtual

Reimplemented from pappso::cbor::psm::PsmFileReaderBase.

Definition at line 80 of file psmfilescanprocess.cpp.

{
// monitor.setStatus(QObject::tr("PsmFileScanProcess::scanFinished
// %1").arg(m_cborScanList.size()));
if(m_cborScanList.size() > m_bufferScanSize)
{
processBufferScan(monitor);
clearScanBuffer();
}
}

References clearScanBuffer(), m_bufferScanSize, m_cborScanList, and processBufferScan().

Referenced by readScan().

## Member Data Documentation

## CborScanMapBase

friend pappso::cbor::psm::PsmFileScanProcess::CborScanMapBase

private

Definition at line 49 of file psmfilescanprocess.h.

Referenced by clearScanBuffer(), newCborScanMap(), processBufferScan(), pappso::cbor::psm::PsmFileScanProcessAndCopy::processBufferScanDone(), and readScan().

## m_bufferScanSize

std::size_t pappso::cbor::psm::PsmFileScanProcess::m_bufferScanSize = 1000

protected

Definition at line 73 of file psmfilescanprocess.h.

Referenced by PsmFileScanProcess(), pappso::cbor::psm::PsmSpecGlob::processBufferScanDone(), pappso::cbor::psm::PsmSpecPeptidOms::processBufferScanDone(), and scanFinished().

## m_cborScanList

std::vector<CborScanMapBase *> pappso::cbor::psm::PsmFileScanProcess::m_cborScanList

protected

Definition at line 74 of file psmfilescanprocess.h.

Referenced by clearScanBuffer(), processBufferScan(), pappso::cbor::psm::PsmFileScanProcessAndCopy::processBufferScanDone(), readScan(), and scanFinished().

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

- pappsomspp/core/processing/cbor/psm/psmfilescanprocess.h
- pappsomspp/core/processing/cbor/psm/psmfilescanprocess.cpp