32#include <QtConcurrent>
53 std::size_t spectrum_index,
58 {peptide_sp.get(), std::make_shared<pappso::masschroq::PeptideObservation>(peptide_sp)});
60 msp_msRun.get()->getPrecursorSPtrBySpectrumIndex(spectrum_index);
61 it.first->second.get()->addObservation({spectrum_index, charge, precursor_sp,
true, p_label});
74 std::size_t scan_number,
79 {peptide_sp.get(), std::make_shared<pappso::masschroq::PeptideObservation>(peptide_sp)});
81 msp_msRun.get()->getPrecursorSPtrByScanNumber(scan_number);
82 it.first->second.get()->addObservation({scan_number, charge, precursor_sp,
false, p_label});
93 const QString &tmp_dir,
99 QString(
"Starting quantification for msrun %1")
100 .arg(
msp_msRun.get()->getMsRunReaderSPtr()->getMsRunId().get()->getFileName()));
110 ui_monitor.
appendText(QString(
"Preparing extraction list"));
111 std::vector<pappso::XicCoordSPtr> xic_coord_list =
114 ui_monitor.
appendText(QString(
"Preparing extraction list done"));
116 ui_monitor.
appendText(QString(
"Building XIC extractor"));
126 extractor_pwiz.get()->setRetentionTimeAroundTarget(
133 extractor_pwiz.get()->setPostExtractionTraceFilterCstSPtr(csp_filter_suite);
137 ui_monitor.
appendText(QString(
"Building XIC extractor done"));
139 extractor_pwiz.get()->extractXicCoordSPtrListParallelized(ui_monitor, xic_coord_list);
148 QString(
"Quantification for msrun %1 done")
149 .arg(
msp_msRun.get()->getMsRunReaderSPtr()->getMsRunId().get()->getFileName()));
153std::vector<pappso::XicCoordSPtr>
158 std::vector<pappso::XicCoordSPtr> xic_coord_list;
165 msrun_group_p, quantification_method, pair_peptide.second, xic_coord_list);
170 return xic_coord_list;
178 std::vector<pappso::XicCoordSPtr> &xic_coord_list)
181 std::make_shared<pappso::masschroq::PeptideMeasurements>(peptide_events_sp);
186 *(
msp_msRun.get()->getMsRunReaderSPtr().get()->getMsRunId().get()),
188 quantification_method);
197 m_uiMonitor.
appendText(QString(
"Detect and quantify peak"));
207 measure->detectQuantifyPeaks(quantification_method);
212 QtConcurrent::map<std::vector<pappso::masschroq::PeptideMeasurementsSp>::iterator>(
214 res.waitForFinished();
217 m_uiMonitor.
appendText(QString(
"Detect and quantify peak done"));
233 measure.get()->flushXics();
238 mbr_measure.get()->flushXics();
242std::shared_ptr<pappso::MsRunRetentionTime<QString>> &
247 std::make_shared<pappso::MsRunRetentionTime<QString>>(
msp_msRun->getRetentionTimeLine());
259 QString peptide_id = observation_pair.first->getId();
261 for(std::uint8_t charge : observation_pair.second->getObservedChargeStates())
265 QString(
"%1-%2").arg(peptide_id).arg(charge),
266 observation_pair.second.get()->getBestXicCoordSPtrForCharge(charge).get()->rtTarget,
300 measures.get()->getPeptideObservationSp().get()->getPeptideSp().get();
302 for(
auto &one_xic_measure : measures.get()->getMeasurementList())
311 QObject::tr(
"error collecting peak retention time in msrun %1 :\n%2")
312 .arg(
msp_msRun.get()->getMsRunReaderSPtr()->getMsRunId()->getXmlId())
313 .arg(error.
qwhat()));
330 measures.get()->getPeptideObservationSp().get()->getPeptideSp().get();
338 QObject::tr(
"error collecting MS2 retention time in msrun %1 :\n%2")
339 .arg(
msp_msRun.get()->getMsRunReaderSPtr()->getMsRunId()->getXmlId())
340 .arg(error.
qwhat()));
349 const std::vector<pappso::masschroq::PeptideSp> &peptide_mbr_list,
350 const QString &tmp_dir,
358 QString(
"Starting quantification for msrun %1 (MBR)")
359 .arg(
msp_msRun.get()->getMsRunReaderSPtr()->getMsRunId().get()->getFileName()));
370 QString(
"MBR Preparing extraction list (%1)").arg(peptide_mbr_list.size()));
373 std::vector<pappso::XicCoordSPtr> xic_coord_list;
375 for(
auto &peptide_sp : peptide_mbr_list)
386 msrun_group_p, quantification_method, peptide_sp, xic_coord_list);
391 ui_monitor.
appendText(QString(
"MBR Preparing extraction list done (%1 %2)")
393 .arg(xic_coord_list.size()));
395 ui_monitor.
appendText(QString(
"MBR Building XIC extractor"));
405 extractor_pwiz.get()->setRetentionTimeAroundTarget(
412 extractor_pwiz.get()->setPostExtractionTraceFilterCstSPtr(csp_filter_suite);
416 ui_monitor.
appendText(QString(
"MBR Building XIC extractor done"));
417 ui_monitor.
appendText(QString(
"MBR Extracting"));
418 extractor_pwiz.get()->extractXicCoordSPtrListParallelized(ui_monitor, xic_coord_list);
426 QString(
"MBR Quantification for msrun %1 done")
427 .arg(
msp_msRun.get()->getMsRunReaderSPtr()->getMsRunId().get()->getFileName()));
432 QObject::tr(
"error in %1 :\n%2").arg(__FUNCTION__).arg(error.
qwhat()));
442 std::vector<pappso::XicCoordSPtr> &xic_coord_list)
445 std::make_shared<pappso::masschroq::MbrPeptideMeasurements>(peptide_sp);
450 *(
msp_msRun.get()->getMsRunReaderSPtr().get()->getMsRunId().get()),
453 quantification_method);
463 m_uiMonitor.
appendText(QString(
"MBR Detect and quantify peak"));
473 measure->detectQuantifyPeaks(quantification_method);
478 QtConcurrent::map<std::vector<pappso::masschroq::MbrPeptideMeasurementsSp>::iterator>(
481 mapdetectQuantifyPeaks);
482 res.waitForFinished();
485 m_uiMonitor.
appendText(QString(
"Detect and quantify peak done"));
500const std::vector<pappso::masschroq::PeptideMeasurementsSp> &
506const std::vector<pappso::masschroq::MbrPeptideMeasurementsSp> &
518 measure.get()->flushXics();
523 mbr_measure.get()->flushXics();
mean filter apply mean of y values inside the window : this results in a kind of smoothing
virtual const QString & qwhat() const
virtual void appendText(const QString &text)=0
append a text to a long report
std::uint8_t getMs2SmoothingWindow() const
std::uint8_t getMs1SmoothingWindow() const
std::uint8_t getMs2TendencyWindow() const
void prepareMeasurements(const pappso::MsRunId &targeted_msrun, const MsRunGroup *msrun_group_p, const pappso::MsRunRetentionTime< QString > &msrun_retention_time, const QuantificationMethodSp &quantification_method)
std::vector< PeptideMeasurementsSp > m_peptideMeasurementsList
void addMbrPeptideMeasurementsSp2XicCoordList(const MsRunGroup *msrun_group_p, const QuantificationMethodSp &quantification_method, const PeptideSp &peptide, std::vector< pappso::XicCoordSPtr > &xic_coord_list)
void quantify(const MsRunGroup *msrun_group_p, const QString &tmp_dir, pappso::UiMonitorInterface &m_uiMonitor, const QuantificationMethodSp &quantification_method)
void detectQuantifyPeaks(pappso::UiMonitorInterface &m_uiMonitor, const QuantificationMethodSp &quantification_method)
void quantifyMatchBetweenRun(const MsRunGroup *msrun_group_p, const std::vector< PeptideSp > &peptide_mbr_list, const QString &tmp_dir, pappso::UiMonitorInterface &m_uiMonitor, const QuantificationMethodSp &quantification_method)
std::map< Peptide *, PeptideObservationSp > m_peptideObservationList
const std::vector< MbrPeptideMeasurementsSp > & getMbrPeptideMeasurementsList() const
const MsRunSp & getMsRunSp() const
std::shared_ptr< pappso::MsRunRetentionTime< QString > > msp_msRunRetentionTime
std::vector< MbrPeptideMeasurementsSp > m_mbrPeptideMeasurementsList
MsRunPeptideList(MsRunSp msrun)
std::vector< pappso::XicCoordSPtr > buildXicCoordList(const MsRunGroup *msrun_group_p, const QuantificationMethodSp &quantification_method)
virtual ~MsRunPeptideList()
void collectPeptideMs2RetentionTime(const pappso::MsRunRetentionTime< QString > *msrun_retention_time_reference_p) const
collect ms2 retention times collect all MS2 events retention times and convert it to the reference ti...
void addPeptideScanNumberObservation(PeptideSp peptide_sp, PeptideLabel *p_label, std::size_t spectrum_index, std::uint8_t charge)
std::shared_ptr< pappso::MsRunRetentionTime< QString > > & buildMsRunRetentionTimeSpOnPeptideObservations(const AlignmentMethodSp &alignment_method)
build a retention time vector with seamarks using MS2 best intensities
void flushChromatogramTraces()
void addPeptideObservation2XicCoordList(const MsRunGroup *msrun_group_p, const QuantificationMethodSp &quantification_method, const PeptideObservationSp &peptide_events_sp, std::vector< pappso::XicCoordSPtr > &xic_coord_list)
pappso::MsRunRetentionTime< QString > * getMsRunRetentionTimePtr() const
void addPeptideSpectrumIndexObservation(PeptideSp peptide_sp, PeptideLabel *p_label, std::size_t spectrum_index, std::uint8_t charge)
void mbrDetectQuantifyPeaks(pappso::UiMonitorInterface &m_uiMonitor, const QuantificationMethodSp &quantification_method)
void clearMeasurements()
clear all measurements MBR or not Clearing measurements also removes every chromatogram
const std::vector< PeptideMeasurementsSp > & getPeptideMeasurementsList() const
const pappso::MsRunRetentionTime< QString > * getMsRunRetentionTimeConstPtr() const
void collectPeptidePeakRetentionTime(const pappso::MsRunRetentionTime< QString > *msrun_retention_time_reference_p) const
collect peak retention times collect all quantified peptides retention times and convert it to the re...
virtual void pushBackXicCoordList(std::vector< pappso::XicCoordSPtr > &xic_coord_list) const final
void prepareMeasurements(const pappso::MsRunId &targeted_msrun, const MsRunGroup *msrun_group_p, const QuantificationMethodSp &quantification_method)
void addMsRunXicCoordCharge(const MsRunXicCoordCharge &msrun_xic_coord)
void setReferenceMsRunRetentionTimePtr(const pappso::MsRunRetentionTime< QString > *msrun_retention_time_reference_p)
sets the current msrun retention time reference
void addAlignedPeptideObservation(const PeptideObservation &peptide_observation, const pappso::MsRunRetentionTime< QString > &msrun_retention_time)
accumulate retention time information for MS2 observation convenient function used while collecting d...
void addAlignedPeakMeasurement(const PeptideMeasurements::Measurement &one_xic_measure, const pappso::MsRunRetentionTime< QString > &msrun_retention_time)
accumulate retention time information for MS1 peak measurement
const pappso::XicCoordSPtr & getXicCoordSPtr() const
double getIntensity() const
Enums::XicExtractMethod getXicExtractMethod() const
double getXicExtractionRtRange() const
const pappso::FilterNameInterfaceSPtr getXicFilter() const
std::shared_ptr< QuantificationMethod > QuantificationMethodSp
std::shared_ptr< PeptideMeasurements > PeptideMeasurementsSp
std::shared_ptr< AlignmentMethod > AlignmentMethodSp
std::shared_ptr< MbrPeptideMeasurements > MbrPeptideMeasurementsSp
std::shared_ptr< Peptide > PeptideSp
std::shared_ptr< Precursor > PrecursorSp
std::shared_ptr< PeptideObservation > PeptideObservationSp
std::shared_ptr< MsRun > MsRunSp
std::shared_ptr< const FilterInterface > FilterInterfaceCstSPtr
std::shared_ptr< MsRunXicExtractorInterface > MsRunXicExtractorInterfaceSp