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

disable the second chance algorithm

parent 0867f3d0
......@@ -35,6 +35,7 @@ QuantificationMethod::QuantificationMethod(const QuantificationMethod &other)
_lower_precision_p = other._lower_precision_p;
_upper_precision_p = other._upper_precision_p;
m_secondChance = other.m_secondChance;
}
QuantificationMethod::~QuantificationMethod()
......@@ -184,3 +185,9 @@ QuantificationMethod::getMzRange(pappso::pappso_double mz) const
{
return pappso::MzRange(mz, _lower_precision_p, _upper_precision_p);
}
bool
QuantificationMethod::getSecondChance() const
{
return m_secondChance;
}
......@@ -71,6 +71,12 @@ class QuantificationMethod
void setXicExtractPrecision(pappso::PrecisionPtr precision);
/** @brief tells if we want a second chance to detect small peaks, very near
* the targeted retention time if enabled, this looks for small peaks with
* boundary retention time smaller than the MS1 minimum range
*/
bool getSecondChance() const;
private:
/// unique xml id for this method
const QString _xml_id;
......@@ -92,4 +98,6 @@ class QuantificationMethod
pappso::PrecisionPtr _lower_precision_p = nullptr;
pappso::PrecisionPtr _upper_precision_p = nullptr;
bool m_secondChance = false;
};
......@@ -209,99 +209,107 @@ XicFilterDetectMatchRealRt::filterDetectQuantify(
}
else
{
qDebug()
<< "XicFilterDetectMatchRealRt::filterDetectQuantify not detected "
<< " " << this;
_monitor.writeMatchedPeak(
_p_current_msrun, _p_current_search_item, nullptr);
_p_log_peaks = new std::vector<pappso::TracePeakCstSPtr>();
_p_detection->detect(*p_xic, *this);
if(_p_log_peaks->size() > 0)
/** @comments look for small little peaks nearby (second chance)
*/
if(_p_quantificator->getQuantificationMethod()->getSecondChance())
{
unsigned int nbpeaks_near = 0;
for(unsigned int i = 0; i < p_real_rt->size(); i++)
qDebug()
<< "XicFilterDetectMatchRealRt::filterDetectQuantify not detected "
<< " " << this;
_monitor.writeMatchedPeak(
_p_current_msrun, _p_current_search_item, nullptr);
_p_log_peaks = new std::vector<pappso::TracePeakCstSPtr>();
_p_detection->detect(*p_xic, *this);
if(_p_log_peaks->size() > 0)
{
pappso::pappso_double rt = p_real_rt->at(i).rt;
for(unsigned int j = 0; j < _p_log_peaks->size(); j++)
unsigned int nbpeaks_near = 0;
for(unsigned int i = 0; i < p_real_rt->size(); i++)
{
pappso::TracePeakCstSPtr peak_sp = _p_log_peaks->at(j);
if(peak_sp.get()->getMaxXicElement().x < rt)
pappso::pappso_double rt = p_real_rt->at(i).rt;
for(unsigned int j = 0; j < _p_log_peaks->size(); j++)
{
if((rt - peak_sp.get()->getRightBoundary().x) < 10)
pappso::TracePeakCstSPtr peak_sp = _p_log_peaks->at(j);
if(peak_sp.get()->getMaxXicElement().x < rt)
{
unsigned int distance_point =
p_origxic->getMsPointDistance(
rt, peak_sp.get()->getRightBoundary().x);
if(distance_point < 10)
if((rt - peak_sp.get()->getRightBoundary().x) < 10)
{
nbpeaks_near++;
unsigned int distance_point =
p_origxic->getMsPointDistance(
rt, peak_sp.get()->getRightBoundary().x);
if(distance_point < 10)
{
nbpeaks_near++;
}
}
}
}
else
{
if((peak_sp.get()->getLeftBoundary().x - rt) < 10)
else
{
unsigned int distance_point =
p_origxic->getMsPointDistance(
rt, peak_sp.get()->getLeftBoundary().x);
if(distance_point == 0)
if((peak_sp.get()->getLeftBoundary().x - rt) < 10)
{
AlignedXicPeak aligned_peak(*(peak_sp.get()),
_p_current_msrun);
_monitor.writeMatchedPeak(_p_current_msrun,
_p_current_search_item,
&aligned_peak);
if(_matching_mode ==
McqMatchingMode::post_matching)
unsigned int distance_point =
p_origxic->getMsPointDistance(
rt, peak_sp.get()->getLeftBoundary().x);
if(distance_point == 0)
{
// store aligned rt of this matched peak
// warning : this could be risky
_p_current_search_item->getPeptideRtSp()
.get()
->postMatchingAlignedPeak(aligned_peak);
}
else
{
_p_current_search_item->getPeptide()
->getPeptideRtSp()
->addWeightedRealXicRt(aligned_peak, 1);
}
AlignedXicPeak aligned_peak(*(peak_sp.get()),
_p_current_msrun);
_monitor.writeMatchedPeak(
_p_current_msrun,
_p_current_search_item,
&aligned_peak);
if(_p_trace != nullptr)
{
_p_trace->setMatchedPeak(*(peak_sp.get()));
_p_trace->setAlignedMatchedPeak(aligned_peak);
if(_matching_mode ==
McqMatchingMode::post_matching)
{
// store aligned rt of this matched peak
// warning : this could be risky
_p_current_search_item->getPeptideRtSp()
.get()
->postMatchingAlignedPeak(aligned_peak);
}
else
{
_p_current_search_item->getPeptide()
->getPeptideRtSp()
->addWeightedRealXicRt(aligned_peak, 1);
}
if(_p_trace != nullptr)
{
_p_trace->setMatchedPeak(
*(peak_sp.get()));
_p_trace->setAlignedMatchedPeak(
aligned_peak);
}
return;
}
return;
nbpeaks_near++;
}
nbpeaks_near++;
}
}
}
}
pappso::PeptideNaturalIsotopeAverageSp peptide_natural_sp =
_p_current_search_item->getPeptideNaturalIsotopeAverageSp();
if(nbpeaks_near > 0)
{
if((peptide_natural_sp == nullptr) ||
(peptide_natural_sp.get()->getIsotopeNumber() == 0))
pappso::PeptideNaturalIsotopeAverageSp peptide_natural_sp =
_p_current_search_item->getPeptideNaturalIsotopeAverageSp();
if(nbpeaks_near > 0)
{
// _monitor.logMissedObservedRealXic(_p_current_search_item,
// p_origxic, p_real_rt,_p_log_peaks);
}
if((peptide_natural_sp == nullptr) ||
(peptide_natural_sp.get()->getIsotopeNumber() == 0))
{
// _monitor.logMissedObservedRealXic(_p_current_search_item,
// p_origxic, p_real_rt,_p_log_peaks);
}
// it seems to be better to forget quanti items that was not
// matched here : leave it in comments
//_p_quantificator->addMissedQuantiItem(_p_current_msrun,
//_p_current_search_item);
// it seems to be better to forget quanti items that was not
// matched here : leave it in comments
//_p_quantificator->addMissedQuantiItem(_p_current_msrun,
//_p_current_search_item);
}
}
else
{
// no peaks : nothing to do
}
}
else
{
// no peaks : nothing to do
}
}
......
Markdown is supported
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