31#include "../pappsoexception.h"
32#include "../exception/exceptionnotfound.h"
33#include "../processing/detection/tracedetectionzivy.h"
44 setXicFilter(std::make_shared<pappso::FilterMorphoAntiSpike>(5));
48 std::make_shared<pappso::TraceDetectionZivy>(1, 3, 2, 5000, 3000);
80 return m_xicExtractionRetentionTimeAroundTarget;
86 m_xicExtractionRetentionTimeAroundTarget = rt_range;
92 return m_matchBetweenRun;
98 if((ratio < 1) && (ratio >= 0))
100 m_isotopeMinimumRatio = ratio;
107 return m_isotopeMinimumRatio;
113 m_xicFilterSuite = std::make_shared<pappso::FilterSuiteString>(
filter.get()->toString());
120 if(m_xicFilterSuite.get() ==
nullptr)
122 m_xicFilterSuite = std::make_shared<pappso::FilterSuiteString>(
filter.get()->toString());
126 m_xicFilterSuite.get()->addFilter(
filter);
133 return m_xicFilterSuite;
144 (mp_xicExtractionLowerPrecisionPtr->getNominal() +
145 mp_xicExtractionUppersPrecisionPtr->getNominal()) /
149 (mp_xicExtractionLowerPrecisionPtr->getNominal() +
150 mp_xicExtractionUppersPrecisionPtr->getNominal()) /
157 return m_xicExtractMethod;
164 mcsp_traceDetectionInterfaceCstSPtr = detection;
171 mp_xicExtractionLowerPrecisionPtr = precision;
178 mp_xicExtractionUppersPrecisionPtr = precision;
184 m_xicExtractMethod = method;
190 return m_xicFilterSuite;
197 return pappso::MzRange(
mz, mp_xicExtractionLowerPrecisionPtr, mp_xicExtractionUppersPrecisionPtr);
203 return mcsp_traceDetectionInterfaceCstSPtr;
214 project_param.
name =
"mcq_xic_extraction_type";
218 project_param.name =
"mcq_mbr";
219 project_param.value.setValue(getMatchBetweenRun());
222 project_param.name =
"mcq_isotope_minimum_ratio";
223 project_param.value.setValue(getIsotopeMinimumRatio());
233 project_param.name =
"mcq_xic_ppm_range_min";
234 project_param.value.setValue(mp_xicExtractionLowerPrecisionPtr->getNominal());
237 project_param.name =
"mcq_xic_ppm_range_max";
238 project_param.value.setValue(mp_xicExtractionUppersPrecisionPtr->getNominal());
247 project_param.name =
"mcq_xic_mz_range_min";
248 project_param.value.setValue(mp_xicExtractionLowerPrecisionPtr->getNominal());
251 project_param.name =
"mcq_xic_mz_range_max";
252 project_param.value.setValue(mp_xicExtractionUppersPrecisionPtr->getNominal());
256 project_param.name =
"mcq_xic_pre_filter";
257 if(m_xicFilterSuite.get() !=
nullptr)
258 project_param.value.setValue(m_xicFilterSuite.get()->toString());
260 project_param.value.setValue(
"");
267 if(detection_zivy !=
nullptr)
269 project_param.name =
"mcq_detection_zivy";
270 project_param.value.setValue(QString(
"%1 %2 %3 %4 %5")
290 if(mp_xicExtractionUppersPrecisionPtr ==
nullptr)
293 "mp_xicExtractionUppersPrecisionPtr == "
296 if(mp_xicExtractionLowerPrecisionPtr ==
nullptr)
299 "mp_xicExtractionLowerPrecisionPtr == "
303 QJsonObject precision;
305 precision.insert(
"down", mp_xicExtractionLowerPrecisionPtr->getNominal());
306 precision.insert(
"up", mp_xicExtractionUppersPrecisionPtr->getNominal());
309 QJsonObject extraction;
310 extraction.insert(
"integration", xic_type);
311 extraction.insert(
"precision", precision);
313 method.insert(
"extraction", extraction);
314 method.insert(
"match_between_run", m_matchBetweenRun);
315 method.insert(
"isotope_minimum_ratio", m_isotopeMinimumRatio);
316 method.insert(
"rt_range", m_xicExtractionRetentionTimeAroundTarget);
320 if(m_xicFilterSuite.get() ==
nullptr)
323 "m_xicFilterSuite.get() == "
326 method.insert(
"pre_filter", m_xicFilterSuite.get()->toString());
332 if(detection_zivy ==
nullptr)
335 "m_quantificationMethod.getTraceDetectionInterfaceCstSPtr().get() == "
339 QJsonObject detection;
340 detection.insert(
"type",
"zivy");
346 method.insert(
"detection", detection);
355 m_matchBetweenRun = quantification_method.value(
"match_between_run").toBool();
356 m_isotopeMinimumRatio = quantification_method.value(
"isotope_minimum_ratio").toDouble();
357 QString filter_str = quantification_method.value(
"pre_filter").toString();
359 qDebug() << filter_str;
360 if(!filter_str.isEmpty())
363 std::make_shared<pappso::FilterSuiteString>(filter_str);
364 addXicFilter(filter_sp);
365 qDebug() << filter_str;
367 QJsonObject extraction = quantification_method.value(
"extraction").toObject();
369 QJsonValue rt_range = extraction.value(
"rt_range");
370 if(!rt_range.isUndefined())
372 setXicExtractionRtRange(rt_range.toDouble());
375 QString integration = extraction.value(
"integration").toString();
376 if(integration ==
"sum")
380 else if(integration ==
"max")
387 QObject::tr(
"missing "
388 "masschroq_methods>quantification_method>extraction>"
389 "integration %1 value")
393 QJsonObject precision = extraction.value(
"precision").toObject();
394 qDebug() << precision.value(
"down").toDouble();
395 qDebug() << precision.value(
"up").toDouble();
397 if(precision.value(
"unit").toString() ==
"dalton")
399 setXicExtractionLowerPrecisionPtr(
401 setXicExtractionUpperPrecisionPtr(
404 else if(precision.value(
"unit").toString() ==
"ppm")
406 setXicExtractionLowerPrecisionPtr(
408 setXicExtractionUpperPrecisionPtr(
414 QObject::tr(
"missing "
415 "masschroq_methods>quantification_method>extraction>precision>"
420 QJsonObject detection = quantification_method.value(
"detection").toObject();
421 if(detection.value(
"type").toString() ==
"zivy")
423 std::shared_ptr<pappso::TraceDetectionZivy> sp_detection_zivy =
424 std::make_shared<pappso::TraceDetectionZivy>(detection.value(
"meanfilter").toInt(),
425 detection.value(
"minmax").toInt(),
426 detection.value(
"maxmin").toInt(),
427 detection.value(
"threshold_on_max").toInt(),
428 detection.value(
"threshold_on_min").toInt());
429 setTraceDetectionInterfaceCstSPtr(sp_detection_zivy);
435 QObject::tr(
"only masschroq_methods>quantification_method>detection>type == zivy "
443 return mp_xicExtractionLowerPrecisionPtr;
449 return mp_xicExtractionUppersPrecisionPtr;
455 m_matchBetweenRun = is_match;
static PrecisionPtr getPpmInstance(pappso_double value)
get a ppm precision pointer
static PrecisionPtr getDaltonInstance(pappso_double value)
get a Dalton precision pointer
void setProjectParam(const ProjectParam ¶m)
unsigned int getMinMaxHalfEdgeWindows() const
unsigned int getSmoothingHalfEdgeWindows() const
double getDetectionThresholdOnMinmax() const
double getDetectionThresholdOnMaxmin() const
unsigned int getMaxMinHalfEdgeWindows() const
pappso::PrecisionPtr mp_xicExtractionUppersPrecisionPtr
void setXicExtractMethod(pappso::XicExtractMethod method)
pappso::XicExtractMethod m_xicExtractMethod
pappso::FilterSuiteStringSPtr m_xicFilterSuite
the xic filters
void setXicExtractionUpperPrecisionPtr(pappso::PrecisionPtr precision)
pappso::PrecisionPtr mp_xicExtractionLowerPrecisionPtr
pappso::XicExtractMethod getXicExtractMethod() const
pappso::TraceDetectionInterfaceCstSPtr mcsp_traceDetectionInterfaceCstSPtr
the peak detection method for this quantification
void setIsotopeMinimumRatio(double ratio)
double getXicExtractionRtRange() const
double m_xicExtractionRetentionTimeAroundTarget
set the retention time range in seconds around the target rt
void setJsonObject(const QJsonObject &json_object)
pappso::PrecisionPtr getXicExtractionLowerPrecisionPtr() const
const pappso::MzRange getXicExtractionMzRange(double mz) const
QuantificationMethod(const QString &id)
const pappso::FilterNameInterfaceSPtr getXicFilter() const
void setMatchBetweenRun(bool is_match)
void setXicFilter(const pappso::FilterNameInterfaceSPtr &filter)
bool getMatchBetweenRun() const
void addXicFilter(const pappso::FilterNameInterfaceSPtr &filter)
const FilterSuiteStringSPtr & getFilterSuiteStringSPtr() const
pappso::PrecisionPtr getXicExtractionUppersPrecisionPtr() const
void setXicExtractionRtRange(double rt_range)
double m_isotopeMinimumRatio
the minimum percentage of theoretical intensity of the isotope pattern to compute
pappso::PrecisionPtr getXicExtractionMeanPrecisionPtr() const
double getIsotopeMinimumRatio() const
pappso::ProjectParameters getProjectParameters() const
virtual ~QuantificationMethod()
const pappso::TraceDetectionInterfaceCstSPtr & getTraceDetectionInterfaceCstSPtr() const
QJsonObject getJsonObject() const
void setXicExtractionLowerPrecisionPtr(pappso::PrecisionPtr precision)
const QString & getId() const
void setTraceDetectionInterfaceCstSPtr(const pappso::TraceDetectionInterfaceCstSPtr &detection)
static QString enumToString(PeakQualityCategory peak_category)
Convenience function to return a string describing the specglob alingment type.
std::shared_ptr< FilterSuiteString > FilterSuiteStringSPtr
std::shared_ptr< const TraceDetectionInterface > TraceDetectionInterfaceCstSPtr
@ quantification
quantification
@ filter
concerning filters (psm, peptide, protein validation)
std::shared_ptr< FilterNameInterface > FilterNameInterfaceSPtr
@ max
maximum of intensities
store parameters related to peak detection and quantification