Loading...
Searching...
No Matches
pappso::TimsDirectXicExtractor Class Reference

`#include <timsdirectxicextractor.h>`

Inheritance diagram for pappso::TimsDirectXicExtractor:

## Public Member Functions

| TimsDirectXicExtractor (MsRunReaderSPtr &msrun_reader)
virtual | ~TimsDirectXicExtractor ()
Public Member Functions inherited from pappso::TimsXicExtractorInterface
| TimsXicExtractorInterface (MsRunReaderSPtr &msrun_reader)
virtual | ~TimsXicExtractorInterface ()
Public Member Functions inherited from pappso::MsRunXicExtractorInterface
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

void | protectedExtractXicCoordSPtrList (UiMonitorInterface &monitor, std::vector< XicCoordSPtr >::iterator it_xic_coord_list_begin, std::vector< XicCoordSPtr >::iterator it_xic_coord_list_end) override
Protected Member Functions inherited from pappso::MsRunXicExtractorInterface
| 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

## Additional Inherited Members

Protected Attributes inherited from pappso::TimsXicExtractorInterface
TimsData * | mp_timsData
Protected Attributes inherited from pappso::MsRunXicExtractorInterface
MsRunReaderSPtr | msp_msrun_reader
XicExtractMethod | m_xicExtractMethod = XicExtractMethod::max
double | m_retentionTimeAroundTarget = std::numeric_limits<double>::max()
pappso::FilterInterfaceCstSPtr | mcsp_postExtractionTraceFilter = nullptr

## Detailed Description

Todo:
  write docs

Definition at line 36 of file timsdirectxicextractor.h.

## Constructor & Destructor Documentation

## TimsDirectXicExtractor()

TimsDirectXicExtractor::TimsDirectXicExtractor | ( | MsRunReaderSPtr & | msrun_reader | ) |

Default constructor

Definition at line 35 of file timsdirectxicextractor.cpp.

: pappso::TimsXicExtractorInterface(msrun_reader)
{
}
pappso::TimsXicExtractorInterface
Definition timsxicextractorinterface.h:43

## ~TimsDirectXicExtractor()

TimsDirectXicExtractor::~TimsDirectXicExtractor | ( |  | ) |

virtual

Destructor

Definition at line 40 of file timsdirectxicextractor.cpp.

{
}

## Member Function Documentation

## protectedExtractXicCoordSPtrList()

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

override protected virtual

Implements pappso::MsRunXicExtractorInterface.

Definition at line 46 of file timsdirectxicextractor.cpp.

{
qDebug();
std::size_t xic_total_number =
std::distance(it_xic_coord_list_begin, it_xic_coord_list_end);
if(xic_total_number == 0)
return;
std::vector<XicCoordTims *> xic_coord_tims_list;
xic_coord_tims_list.reserve(xic_total_number);
for(auto it = it_xic_coord_list_begin; it != it_xic_coord_list_end; it++)
{
XicCoordTims *p_xic_coord_tims = dynamic_cast<XicCoordTims *>(it->get());
if(p_xic_coord_tims == nullptr)
{
}
else
{
xic_coord_tims_list.push_back(p_xic_coord_tims);
}
}
std::sort(xic_coord_tims_list.begin(),
xic_coord_tims_list.end(),
[](const XicCoordTims *pa, const XicCoordTims *pb) {
return pa->rtTarget < pb->rtTarget;
});
std::vector<std::size_t> tims_frameid_list =
mp_timsData->getTimsMS1FrameIdRange(
xic_coord_tims_list[0]->rtTarget - m_retentionTimeAroundTarget,
xic_coord_tims_list.back()->rtTarget + m_retentionTimeAroundTarget);
monitor.setStatus(QObject::tr("extracting %1 XICs on %2 Tims frames")
.arg(xic_total_number)
.arg(tims_frameid_list.size()));
monitor.setTotalSteps(tims_frameid_list.size());
qDebug() << " tims_frameid_list.size()=" << tims_frameid_list.size();
qDebug() << " rt begin=" << xic_coord_tims_list[0]->rtTarget;
qDebug() << " rt end=" << xic_coord_tims_list.back()->rtTarget;
for(std::size_t frame_id : tims_frameid_list)
{
std::vector<XicCoordTims *>::iterator itXicListbegin =
xic_coord_tims_list.begin();
std::vector<XicCoordTims *>::iterator itXicListend =
xic_coord_tims_list.end();
qDebug();
TimsFrameCstSPtr frame_sptr =
mp_timsData->getTimsFrameCstSPtrCached(frame_id);
qDebug();
double rtframe = frame_sptr.get()->getTime();
qDebug();
double rtbeginframe = rtframe - m_retentionTimeAroundTarget;
double rtendframe = rtframe + m_retentionTimeAroundTarget;
if(rtbeginframe < 0)
rtbeginframe = 0;
qDebug() << rtbeginframe;
while((itXicListbegin != itXicListend) &&
((*itXicListbegin)->rtTarget < rtbeginframe))
{
itXicListbegin++;
}
qDebug();
itXicListend = itXicListbegin;
while((itXicListend != xic_coord_tims_list.end()) &&
((*itXicListend)->rtTarget < rtendframe))
{
itXicListend++;
}
frame_sptr.get()->extractTimsXicListInRtRange(
itXicListbegin, itXicListend, m_xicExtractMethod);
qDebug() << "" << frame_sptr.get()->getId();
monitor.count();
if(monitor.shouldIstop())
{
throw pappso::ExceptionInterrupted(
QObject::tr("Xic extraction process interrupted"));
}
}
qDebug();
}
pappso::ExceptionInterrupted
Definition exceptioninterrupted.h:36
pappso::MsRunXicExtractorInterface::m_retentionTimeAroundTarget
double m_retentionTimeAroundTarget
Definition msrunxicextractorinterface.h:128
pappso::MsRunXicExtractorInterface::m_xicExtractMethod
XicExtractMethod m_xicExtractMethod
Definition msrunxicextractorinterface.h:127
pappso::TimsData::getTimsFrameCstSPtrCached
TimsFrameCstSPtr getTimsFrameCstSPtrCached(std::size_t timsId)
get a Tims frame with his database ID but look in the cache first
Definition timsdata.cpp:1096
pappso::TimsData::getTimsMS1FrameIdRange
std::vector< std::size_t > getTimsMS1FrameIdRange(double rt_begin, double rt_end) const
Definition timsdata.cpp:492
pappso::TimsXicExtractorInterface::mp_timsData
TimsData * mp_timsData
Definition timsxicextractorinterface.h:51
pappso::UiMonitorInterface::setStatus
virtual void setStatus(const QString &status)=0
current status of the process
pappso::UiMonitorInterface::setTotalSteps
virtual void setTotalSteps(std::size_t total_number_of_steps)
use it if the number of steps is known in an algorithm the total number of steps is usefull to report...
Definition uimonitorinterface.h:66
pappso::UiMonitorInterface::shouldIstop
virtual bool shouldIstop()=0
should the procces be stopped ? If true, then cancel process Use this function at strategic point of ...
pappso::UiMonitorInterface::count
virtual void count()=0
count steps report when a step is computed in an algorithm
pappso::TimsFrameCstSPtr
std::shared_ptr< const TimsFrame > TimsFrameCstSPtr
Definition timsframe.h:42
pappso::XicCoordTims
coordinates of the XIC to extract and the resulting XIC after extraction
Definition xiccoordtims.h:51

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

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

- pappsomspp/vendors/tims/xicextractor/timsdirectxicextractor.h
- pappsomspp/vendors/tims/xicextractor/timsdirectxicextractor.cpp