Loading...
Searching...
No Matches
pappso::MsRunXicExtractorInterface Class Referenceabstract

`#include <msrunxicextractorinterface.h>`

Inheritance diagram for pappso::MsRunXicExtractorInterface:

## Public Member Functions

void | setXicExtractMethod (XicExtractMethod method)
| set the XIC extraction method
void | setRetentionTimeAroundTarget (double range_in_seconds)
| set the retention time range in seconds around the target rt
virtual void | extractXicCoordSPtrList (UiMonitorInterface &monitor, std::vector< XicCoordSPtr > &xic_coord_list) final
| extract a list of XIC given a list of xic coordinates to extract
virtual void | extractXicCoordSPtrListParallelized (UiMonitorInterface &monitor, std::vector< XicCoordSPtr > &xic_coord_list) final
| multithreaded XIC extraction
const MsRunIdCstSPtr & | getMsRunId () const
const MsRunReaderSPtr & | getMsRunReaderSPtr () const
| get the msrunreader currently used for XIC extraction
void | setPostExtractionTraceFilterCstSPtr (pappso::FilterInterfaceCstSPtr &filter)
| filter interface to apply just after XIC extration on each trace

## Protected Member Functions

| MsRunXicExtractorInterface (MsRunReaderSPtr &msrun_reader)
| constructor is private, use the MsRunXicExtractorFactory
| MsRunXicExtractorInterface (const MsRunXicExtractorInterface &other)
virtual | ~MsRunXicExtractorInterface ()
virtual void | postExtractionProcess (UiMonitorInterface &monitor, std::vector< XicCoordSPtr >::iterator it_xic_coord_list_begin, std::vector< XicCoordSPtr >::iterator it_xic_coord_list_end)
| possible post extraction process, eventually trace filters
virtual void | protectedExtractXicCoordSPtrList (UiMonitorInterface &monitor, std::vector< XicCoordSPtr >::iterator it_xic_coord_list_begin, std::vector< XicCoordSPtr >::iterator it_xic_coord_list_end)=0

## Protected Attributes

MsRunReaderSPtr | msp_msrun_reader
XicExtractMethod | m_xicExtractMethod = XicExtractMethod::max
double | m_retentionTimeAroundTarget = std::numeric_limits<double>::max()
pappso::FilterInterfaceCstSPtr | mcsp_postExtractionTraceFilter = nullptr

## Detailed Description

Definition at line 48 of file msrunxicextractorinterface.h.

## Constructor & Destructor Documentation

## MsRunXicExtractorInterface() [1/2]

pappso::MsRunXicExtractorInterface::MsRunXicExtractorInterface | ( | MsRunReaderSPtr & | msrun_reader | ) |

protected

constructor is private, use the MsRunXicExtractorFactory

Definition at line 40 of file msrunxicextractorinterface.cpp.

: msp_msrun_reader(msrun_reader)
{
}
pappso::MsRunXicExtractorInterface::msp_msrun_reader
MsRunReaderSPtr msp_msrun_reader
Definition msrunxicextractorinterface.h:126

## MsRunXicExtractorInterface() [2/2]

pappso::MsRunXicExtractorInterface::MsRunXicExtractorInterface | ( | const MsRunXicExtractorInterface & | other | ) |

protected

Definition at line 47 of file msrunxicextractorinterface.cpp.

: msp_msrun_reader(other.msp_msrun_reader)
{
m_xicExtractMethod = other.m_xicExtractMethod;
}
pappso::MsRunXicExtractorInterface::m_xicExtractMethod
XicExtractMethod m_xicExtractMethod
Definition msrunxicextractorinterface.h:127

References m_xicExtractMethod.

## ~MsRunXicExtractorInterface()

pappso::MsRunXicExtractorInterface::~MsRunXicExtractorInterface | ( |  | ) |

protected virtual

Definition at line 54 of file msrunxicextractorinterface.cpp.

{
}

## Member Function Documentation

## extractXicCoordSPtrList()

void pappso::MsRunXicExtractorInterface::extractXicCoordSPtrList | ( | UiMonitorInterface & | monitor,
|  | std::vector< XicCoordSPtr > & | xic_coord_list
| ) |  |

final virtual

extract a list of XIC given a list of xic coordinates to extract

XicCoord is a vessel containing the xic to fill and coordinates of this XIC in the MS run

Parameters

  monitor | process monitoring
  xic_coord_list | list of xic coordinates to extract. The order of xic coordinates may change.

Definition at line 181 of file msrunxicextractorinterface.cpp.

{
monitor.setStatus(
QObject::tr("extracting %1 XICs").arg(xic_coord_list.size()));
monitor.setTotalSteps(xic_coord_list.size());
protectedExtractXicCoordSPtrList(
monitor, xic_coord_list.begin(), xic_coord_list.end());
monitor.setTotalSteps(0);
postExtractionProcess(monitor, xic_coord_list.begin(), xic_coord_list.end());
}
pappso::MsRunXicExtractorInterface::postExtractionProcess
virtual void postExtractionProcess(UiMonitorInterface &monitor, std::vector< XicCoordSPtr >::iterator it_xic_coord_list_begin, std::vector< XicCoordSPtr >::iterator it_xic_coord_list_end)
possible post extraction process, eventually trace filters
Definition msrunxicextractorinterface.cpp:195
pappso::MsRunXicExtractorInterface::protectedExtractXicCoordSPtrList
virtual void protectedExtractXicCoordSPtrList(UiMonitorInterface &monitor, std::vector< XicCoordSPtr >::iterator it_xic_coord_list_begin, std::vector< XicCoordSPtr >::iterator it_xic_coord_list_end)=0

References postExtractionProcess(), protectedExtractXicCoordSPtrList(), pappso::UiMonitorInterface::setStatus(), and pappso::UiMonitorInterface::setTotalSteps().

Referenced by extractXicCoordSPtrListParallelized().

## extractXicCoordSPtrListParallelized()

void pappso::MsRunXicExtractorInterface::extractXicCoordSPtrListParallelized | ( | UiMonitorInterface & | monitor,
|  | std::vector< XicCoordSPtr > & | xic_coord_list
| ) |  |

final virtual

multithreaded XIC extraction

divide xic_coord_list and run extractXicCoordSPtrList separated threads

Parameters

  monitor | process monitoring
  xic_coord_list | list of xic coordinates to extract. The order of xic coordinates may change.

Definition at line 92 of file msrunxicextractorinterface.cpp.

{
qDebug();
// get the number of available threads :
int number_of_threads = QThreadPool::globalInstance()->maxThreadCount();
if(number_of_threads == 1)
{
extractXicCoordSPtrList(monitor, xic_coord_list);
}
else
{
monitor.setStatus(QObject::tr("parallelized extraction of %1 XICs")
.arg(xic_coord_list.size()));
std::size_t chunck_size = xic_coord_list.size() / number_of_threads;
chunck_size += 1;
if(chunck_size < 1000)
chunck_size = 1000;
struct parallelExtractChunck
{
std::vector<XicCoordSPtr>::iterator it_xic_coord_begin;
std::vector<XicCoordSPtr>::iterator it_xic_coord_end;
};
std::vector<parallelExtractChunck> chunck_list;
qDebug();
for(auto it = xic_coord_list.begin(); it != xic_coord_list.end();)
{
qDebug() << "chunck_size=" << chunck_size;
parallelExtractChunck chunck;
chunck.it_xic_coord_begin = it;
for(std::size_t i = 0; i < chunck_size && it != xic_coord_list.end();
i++)
{
it++;
}
chunck.it_xic_coord_end = it;
chunck_list.push_back(chunck);
}
qDebug();
auto self = this;
qDebug();
std::function<std::size_t(const parallelExtractChunck &)> extractChunck =
[self](const parallelExtractChunck &extract_chunck) {
qDebug();
UiMonitorVoid monitor;
self->protectedExtractXicCoordSPtrList(
monitor,
extract_chunck.it_xic_coord_begin,
extract_chunck.it_xic_coord_end);
self->postExtractionProcess(monitor,
extract_chunck.it_xic_coord_begin,
extract_chunck.it_xic_coord_end);
qDebug();
return 1;
};
qDebug();
monitor.setTotalSteps(chunck_list.size());
UiMonitorInterface *monitorRef = &monitor;
std::function<void(std::size_t & result, const std::size_t &value)>
monitorExtract2 =
[monitorRef](std::size_t &result [[maybe_unused]],
const std::size_t &value
[[maybe_unused]]) { monitorRef->count(); };
qDebug();
QFuture<std::size_t> res =
QtConcurrent::mappedReduced<std::size_t>(chunck_list.begin(),
chunck_list.end(),
extractChunck,
monitorExtract2,
QtConcurrent::UnorderedReduce);
qDebug();
/*
QFuture<std::size_t> res =
QtConcurrent::mapped(chunck_list.begin(), chunck_list.end(),
extractChunck);
*/
res.waitForFinished();
monitor.setTotalSteps(0);
}
}
pappso::MsRunXicExtractorInterface::extractXicCoordSPtrList
virtual void extractXicCoordSPtrList(UiMonitorInterface &monitor, std::vector< XicCoordSPtr > &xic_coord_list) final
extract a list of XIC given a list of xic coordinates to extract
Definition msrunxicextractorinterface.cpp:181
pappso::PrecisionUnit::res
@ res

References pappso::UiMonitorInterface::count(), extractXicCoordSPtrList(), pappso::res, pappso::UiMonitorInterface::setStatus(), and pappso::UiMonitorInterface::setTotalSteps().

## getMsRunId()

const MsRunIdCstSPtr & pappso::MsRunXicExtractorInterface::getMsRunId | ( |  | ) | const

Definition at line 72 of file msrunxicextractorinterface.cpp.

{
return msp_msrun_reader.get()->getMsRunId();
}

References msp_msrun_reader.

## getMsRunReaderSPtr()

const MsRunReaderSPtr & pappso::MsRunXicExtractorInterface::getMsRunReaderSPtr | ( |  | ) | const

get the msrunreader currently used for XIC extraction

Definition at line 78 of file msrunxicextractorinterface.cpp.

{
return msp_msrun_reader;
}

References msp_msrun_reader.

## postExtractionProcess()

void pappso::MsRunXicExtractorInterface::postExtractionProcess | ( | UiMonitorInterface & | monitor,
|  | std::vector< XicCoordSPtr >::iterator | it_xic_coord_list_begin,
|  | std::vector< XicCoordSPtr >::iterator | it_xic_coord_list_end
| ) |  |

protected virtual

possible post extraction process, eventually trace filters

Definition at line 195 of file msrunxicextractorinterface.cpp.

{
if(mcsp_postExtractionTraceFilter != nullptr)
{
monitor.setStatus(
QObject::tr("filtering %1 XICs")
.arg(std::distance(it_xic_coord_list_begin, it_xic_coord_list_end)));
for(auto it = it_xic_coord_list_begin; it != it_xic_coord_list_end; it++)
{
mcsp_postExtractionTraceFilter.get()->filter(
*(it->get()->xicSptr.get()));
}
}
}
pappso::MsRunXicExtractorInterface::mcsp_postExtractionTraceFilter
pappso::FilterInterfaceCstSPtr mcsp_postExtractionTraceFilter
Definition msrunxicextractorinterface.h:129

References mcsp_postExtractionTraceFilter, and pappso::UiMonitorInterface::setStatus().

Referenced by extractXicCoordSPtrList().

## protectedExtractXicCoordSPtrList()

virtual void pappso::MsRunXicExtractorInterface::protectedExtractXicCoordSPtrList | ( | UiMonitorInterface & | monitor,
|  | std::vector< XicCoordSPtr >::iterator | it_xic_coord_list_begin,
|  | std::vector< XicCoordSPtr >::iterator | it_xic_coord_list_end
| ) |  |

protected pure virtual

Implemented in pappso::TimsDirectXicExtractor, pappso::MsRunXicExtractor, and pappso::MsRunXicExtractorDisk.

Referenced by extractXicCoordSPtrList().

## setPostExtractionTraceFilterCstSPtr()

void pappso::MsRunXicExtractorInterface::setPostExtractionTraceFilterCstSPtr | ( | pappso::FilterInterfaceCstSPtr & | filter | ) |

filter interface to apply just after XIC extration on each trace

Definition at line 84 of file msrunxicextractorinterface.cpp.

{
mcsp_postExtractionTraceFilter = filter;
}

References mcsp_postExtractionTraceFilter.

## setRetentionTimeAroundTarget()

void pappso::MsRunXicExtractorInterface::setRetentionTimeAroundTarget | ( | double | range_in_seconds | ) |

set the retention time range in seconds around the target rt

only the interesting part of the xic will be extracted, form the rt target

- range_in_seconds to rt target + range in seconds by default, all the LC run time is extracted

Parameters

  range_in_seconds | range in seconds

Definition at line 65 of file msrunxicextractorinterface.cpp.

{
m_retentionTimeAroundTarget = range_in_seconds;
}
pappso::MsRunXicExtractorInterface::m_retentionTimeAroundTarget
double m_retentionTimeAroundTarget
Definition msrunxicextractorinterface.h:128

References m_retentionTimeAroundTarget.

## setXicExtractMethod()

void pappso::MsRunXicExtractorInterface::setXicExtractMethod | ( | XicExtractMethod | method | ) |

set the XIC extraction method

Definition at line 59 of file msrunxicextractorinterface.cpp.

{
m_xicExtractMethod = method;
}

References m_xicExtractMethod.

## Member Data Documentation

## m_retentionTimeAroundTarget

double pappso::MsRunXicExtractorInterface::m_retentionTimeAroundTarget = std::numeric_limits<double>::max()

protected

Definition at line 128 of file msrunxicextractorinterface.h.

Referenced by pappso::MsRunXicExtractor::extractOneXicCoord(), pappso::MsRunXicExtractorDisk::extractOneXicCoord(), and setRetentionTimeAroundTarget().

## m_xicExtractMethod

XicExtractMethod pappso::MsRunXicExtractorInterface::m_xicExtractMethod = XicExtractMethod::max

protected

Definition at line 127 of file msrunxicextractorinterface.h.

Referenced by MsRunXicExtractorInterface(), pappso::MsRunXicExtractor::extractOneXicCoord(), pappso::MsRunXicExtractorDisk::extractOneXicCoord(), pappso::MsRunXicExtractor::getXicFromPwizMSDataFile(), and setXicExtractMethod().

## mcsp_postExtractionTraceFilter

pappso::FilterInterfaceCstSPtr pappso::MsRunXicExtractorInterface::mcsp_postExtractionTraceFilter = nullptr

protected

Definition at line 129 of file msrunxicextractorinterface.h.

Referenced by postExtractionProcess(), and setPostExtractionTraceFilterCstSPtr().

## msp_msrun_reader

MsRunReaderSPtr pappso::MsRunXicExtractorInterface::msp_msrun_reader

protected

Definition at line 126 of file msrunxicextractorinterface.h.

Referenced by pappso::MsRunXicExtractor::MsRunXicExtractor(), pappso::MsRunXicExtractorDisk::MsRunXicExtractorDisk(), pappso::MsRunXicExtractorDisk::endPwizRead(), pappso::MsRunXicExtractorDiskBuffer::endPwizRead(), pappso::MsRunXicExtractor::extractOneXicCoord(), getMsRunId(), getMsRunReaderSPtr(), pappso::MsRunXicExtractor::getXicFromPwizMSDataFile(), pappso::MsRunXicExtractorDisk::prepareExtractor(), and pappso::MsRunXicExtractorDisk::serializeMsRun().

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

- pappsomspp/xicextractor/msrunxicextractorinterface.h
- pappsomspp/xicextractor/msrunxicextractorinterface.cpp