Commit c0e5bb78 authored by Langella Olivier's avatar Langella Olivier
Browse files

no_matching mode seems to work, version 2.2.19

parent 953b3cac
......@@ -31,7 +31,7 @@ configure_file (${CMAKE_SOURCE_DIR}/debian/control.cmake ${CMAKE_SOURCE_DIR}/deb
SET (MASSCHROQ_MAJOR_VERSION 2)
SET (MASSCHROQ_MINOR_VERSION 2)
SET (MASSCHROQ_PATCH_LEVEL 18)
SET (MASSCHROQ_PATCH_LEVEL 19)
SET (MASSCHROQ_VERSION
"${MASSCHROQ_MAJOR_VERSION}.${MASSCHROQ_MINOR_VERSION}.${MASSCHROQ_PATCH_LEVEL}")
SET (MASSCHROQ_LIB_NAME "masschroq")
......
......@@ -113,13 +113,6 @@ MsrunLoaderThread::run()
emit errorDuringLoading(errorp.qwhat());
return;
}
catch(mcqError &error)
{
mcqerr() << "Oops! an error occurred in MassChroQ. Dont Panic :" << endl;
mcqerr() << error.qwhat() << endl;
emit errorDuringLoading(error.qwhat());
return;
}
// If all ok, emit loading finish
if(!this->getRestart() & !this->getAbord())
......
......@@ -28,6 +28,7 @@
#include <cmath>
#include <numeric>
#include <pappsomspp/processing/detection/tracepeak.h>
#include "../share/utilities.h"
PeptideRt::PeptideRt()
{
......@@ -106,9 +107,12 @@ pappso::pappso_double
PeptideRt::getRtTarget(const Msrun *p_msrun,
McqMatchingMode matching_mode) const
{
if((matching_mode == McqMatchingMode::real_or_mean) ||
(matching_mode == McqMatchingMode::realxic_or_mean) ||
(matching_mode == McqMatchingMode::post_matching))
(matching_mode == McqMatchingMode::post_matching) ||
(matching_mode == McqMatchingMode::no_matching))
{
auto it = std::find_if(_msrun_to_real_rt.begin(),
_msrun_to_real_rt.end(),
......@@ -122,6 +126,20 @@ PeptideRt::getRtTarget(const Msrun *p_msrun,
return (it->rt);
}
}
else
{
throw mcqError(
QObject::tr("Error in PeptideRt::getRtTarget unable "
"to compute retention time reference with mode %1")
.arg(Utilities::toString(matching_mode)));
}
/*
if(matching_mode == McqMatchingMode::no_matching)
{
return (_aligned_rt);
}*/
if(_aligned_rt == -1)
{
return -1;
......@@ -137,7 +155,8 @@ PeptideRt::computeRetentionTimeReferences(McqMatchingMode matching_mode)
// compute peptide retention time references :
if((matching_mode == McqMatchingMode::mean) ||
(matching_mode == McqMatchingMode::real_or_mean) ||
(matching_mode == McqMatchingMode::post_matching))
(matching_mode == McqMatchingMode::post_matching) ||
(matching_mode == McqMatchingMode::no_matching))
{
// sort observations by ms runs, with the most intense last
qDebug() << "PeptideRt::computeRetentionTimeReferences sort "
......@@ -199,12 +218,11 @@ PeptideRt::computeRetentionTimeReferences(McqMatchingMode matching_mode)
throw mcqError(
QObject::tr("Error in PeptideRt::computeRetentionTimeReferences unable "
"to compute retention time reference with mode %1")
.arg((quint16) matching_mode));
.arg(Utilities::toString(matching_mode)));
}
_aligned_rt = -1;
if(_accumulator.size() == 0)
{
_aligned_rt = -1;
if(matching_mode == McqMatchingMode::realxic_or_mean)
{
// idea : if there is nothing better, compute mean :
......@@ -215,15 +233,20 @@ PeptideRt::computeRetentionTimeReferences(McqMatchingMode matching_mode)
else
{
qDebug() << "PeptideRt::computeRetentionTimeReferences accumulate"
<< _accumulator.size();
_aligned_rt =
std::accumulate(_accumulator.begin(), _accumulator.end(), 0.0) /
_accumulator.size();
if(matching_mode != McqMatchingMode::no_matching)
{
qDebug() << "PeptideRt::computeRetentionTimeReferences accumulate"
<< _accumulator.size();
_aligned_rt =
std::accumulate(_accumulator.begin(), _accumulator.end(), 0.0) /
_accumulator.size();
qDebug() << "PeptideRt::computeRetentionTimeReferences end "
<< _aligned_rt << " " << _accumulator.size() << " "
<< std::accumulate(
_accumulator.begin(), _accumulator.end(), 0.0);
}
}
qDebug() << "PeptideRt::computeRetentionTimeReferences end " << _aligned_rt
<< " " << _accumulator.size() << " "
<< std::accumulate(_accumulator.begin(), _accumulator.end(), 0.0);
_accumulator.clear();
//_msms_observation_list.clear();
......
......@@ -56,8 +56,10 @@ MapQuanti::operator()(QuantiItemBase *p_currentSearchItem)
if(p_peptide_rt != nullptr)
{
rt_target = p_peptide_rt->getRtTarget(_p_msrun, _matching_mode);
if(std::isnan(rt_target))
{
qDebug() << " isnan(rt_target) "
......@@ -76,10 +78,6 @@ MapQuanti::operator()(QuantiItemBase *p_currentSearchItem)
{
// it's Ok, just detect and keep peaks
}
else if(_matching_mode == McqMatchingMode::no_matching)
{
rt_target = p_currentSearchItem->getRt();
}
else
{
qDebug() << " rt_target == -1 exit";
......
......@@ -90,6 +90,7 @@ MapQuantiRealXic::operator()(QuantiItemBase *p_currentSearchItem)
// rt_list_z.size();
// if (rt_list_z.size() > 0) {
// and it was observed with this charge
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
XicFilterDetectMatchRealRt filter_detect_match_real_xic(
p_xic_trace,
_monitor,
......@@ -97,14 +98,17 @@ MapQuantiRealXic::operator()(QuantiItemBase *p_currentSearchItem)
_p_detection,
_quantificator,
_matching_mode);
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
pappso::MzRange mass_range(
p_currentSearchItem->getMz(),
_quantificator->getQuantificationMethod()->getLowerPrecision(),
_quantificator->getQuantificationMethod()->getUpperPrecision());
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
pappso::XicCstSPtr msrun_xic_sp =
_msrun_xic_extractor_sp.get()->getXicCstSPtr(mass_range);
_p_msrun->extractXicCstSPtr(mass_range, rt_list[0].rt);
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
if(msrun_xic_sp != nullptr)
{
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
......
......@@ -36,7 +36,6 @@ struct MapQuantiRealXic
pappso::TraceDetectionInterfaceCstSPtr _p_detection;
McqMatchingMode _matching_mode;
Quantificator *_quantificator;
pappso::MsRunXicExtractorInterfaceSp _msrun_xic_extractor_sp;
MapQuantiRealXic(MonitorSpeedInterface &monitor,
Msrun *current_msrun,
......
......@@ -16,6 +16,7 @@
#include "quantifications/quantificationMethod.h"
#include "xic/xicfilterdetectmatch.h"
#include <pappsomspp/peptide/peptidenaturalisotopelist.h>
#include "share/utilities.h"
#include "peptides/peptidert.h"
#include <QDir>
......@@ -368,7 +369,8 @@ Quantificator::quantify()
unsigned int count_msruns(1);
std::vector<QuantiItemBase *>::const_iterator itmz;
if(_matching_mode == McqMatchingMode::realxic_or_mean)
if((_matching_mode == McqMatchingMode::realxic_or_mean) ||
(_matching_mode == McqMatchingMode::no_matching))
{
count_msruns = 1;
......@@ -382,19 +384,21 @@ Quantificator::quantify()
mcqout() << QObject::tr(
"Quantification '%1' : preparing MS run '%2' to "
"extract and quantify %3 XICs")
"extract and quantify %3 XICs (%4)")
.arg(_xml_id)
.arg(current_msrun->getMsRunIdCstSPtr()->getXmlId())
.arg(_quanti_item_list.size())
.arg(Utilities::toString(_matching_mode))
<< endl;
current_msrun->buildMsRunXicExtractor(xic_extract_method);
mcqout() << QObject::tr(
"quantifying MS run '%1' : %2/%3 in group '%4'")
"quantifying MS run '%1' : %2/%3 in group '%4' (%5)")
.arg(current_msrun->getMsRunIdCstSPtr()->getXmlId())
.arg(count_msruns)
.arg(_group_to_quantify->size())
.arg(group_id)
.arg(Utilities::toString(_matching_mode))
<< endl;
MapQuantiRealXic mapQuanti(*_p_monitor_speed,
......
......@@ -23,8 +23,7 @@
* \author Edlira Nano
*/
#ifndef UTILITIES_H_
#define UTILITIES_H_ 1
#pragma once
#include "../../config.h"
#include "../mcq_error.h"
......@@ -117,5 +116,3 @@ class Utilities
static const QString toString(const McqMatchingMode raw_data_format);
static const QString toString(pappso::XicExtractMethod raw_data_format);
};
#endif /* UTILITIES_H_ */
......@@ -33,13 +33,14 @@ XicFilterDetectMatchRealRt::XicFilterDetectMatchRealRt(
McqMatchingMode matching_mode)
: _monitor(monitor)
{
qDebug() << "XicFilterDetectMatchRealRt::XicFilterDetectMatchRealRt " << this;
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
_p_detection = p_detection;
_p_xic_filter = p_xic_filter;
_p_quantificator = p_quantificator;
_p_trace = p_trace;
_matching_mode = matching_mode;
qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
}
XicFilterDetectMatchRealRt::~XicFilterDetectMatchRealRt()
......
......@@ -26,12 +26,6 @@ class MyAppMcq : public QCoreApplication
<< ex.qwhat().toStdString() << std::endl;
throw ex;
}
catch(mcqError &ex)
{
std::cerr << "mcqError was caught:\n"
<< ex.qwhat().toStdString() << std::endl;
throw ex;
}
catch(std::exception &ex)
{
std::cerr << "std::exception was caught:\n" << ex.what() << std::endl;
......
......@@ -30,8 +30,7 @@
* session
*/
#ifndef MCQSESSION_H
#define MCQSESSION_H
#pragma once
#include <QTemporaryDir>
#include <memory>
......@@ -89,4 +88,3 @@ class McqSession
*/
pappso::pappso_double _m_retention_time_range = 300;
};
#endif // MCQSESSION_H
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment