libpappsomspp
Library for mass spectrometry
pappso::masschroq::QuantificationMethod Class Reference

#include <quantificationmethod.h>

Public Member Functions

 QuantificationMethod (const QString &id)
 
 QuantificationMethod (const QuantificationMethod &other)
 
virtual ~QuantificationMethod ()
 
const QString & getId () const
 
void setXicExtractMethod (pappso::XicExtractMethod method)
 
pappso::XicExtractMethod getXicExtractMethod () const
 
void setXicExtractionLowerPrecisionPtr (pappso::PrecisionPtr precision)
 
void setXicExtractionUpperPrecisionPtr (pappso::PrecisionPtr precision)
 
pappso::PrecisionPtr getXicExtractionMeanPrecisionPtr () const
 
void addXicFilter (const pappso::FilterNameInterfaceSPtr &filter)
 
void setXicFilter (const pappso::FilterNameInterfaceSPtr &filter)
 
void setTraceDetectionInterfaceCstSPtr (const pappso::TraceDetectionInterfaceCstSPtr &detection)
 
const pappso::TraceDetectionInterfaceCstSPtrgetTraceDetectionInterfaceCstSPtr () const
 
const pappso::FilterNameInterfaceSPtr getXicFilter () const
 
const FilterSuiteStringSPtrgetFilterSuiteStringSPtr () const
 
const pappso::MzRange getXicExtractionMzRange (double mz) const
 
pappso::ProjectParameters getProjectParameters () const
 
void setJsonObject (const QJsonObject &json_object)
 
QJsonObject getJsonObject () const
 
pappso::PrecisionPtr getXicExtractionLowerPrecisionPtr () const
 
pappso::PrecisionPtr getXicExtractionUppersPrecisionPtr () const
 
void setMatchBetweenRun (bool is_match)
 
bool getMatchBetweenRun () const
 
void setIsotopeMinimumRatio (double ratio)
 
double getIsotopeMinimumRatio () const
 
void setXicExtractionRtRange (double rt_range)
 
double getXicExtractionRtRange () const
 

Private Attributes

const QString m_id
 
pappso::XicExtractMethod m_xicExtractMethod = pappso::XicExtractMethod::max
 
pappso::PrecisionPtr mp_xicExtractionLowerPrecisionPtr = nullptr
 
pappso::PrecisionPtr mp_xicExtractionUppersPrecisionPtr = nullptr
 
double m_xicExtractionRetentionTimeAroundTarget = 300
 set the retention time range in seconds around the target rt More...
 
pappso::FilterSuiteStringSPtr m_xicFilterSuite
 the xic filters More...
 
pappso::TraceDetectionInterfaceCstSPtr mcsp_traceDetectionInterfaceCstSPtr
 the peak detection method for this quantification More...
 
bool m_matchBetweenRun = true
 
double m_isotopeMinimumRatio = 0
 the minimum percentage of theoretical intensity of the isotope pattern to compute More...
 

Detailed Description

Todo:
write docs

Definition at line 51 of file quantificationmethod.h.

Constructor & Destructor Documentation

◆ QuantificationMethod() [1/2]

pappso::masschroq::QuantificationMethod::QuantificationMethod ( const QString &  id)

Default constructor

Definition at line 35 of file quantificationmethod.cpp.

35 : m_id(id)
36{
37 // by default
38 qDebug();
42
43 qDebug();
44 setXicFilter(std::make_shared<pappso::FilterMorphoAntiSpike>(5));
45
46 qDebug();
48 std::make_shared<pappso::TraceDetectionZivy>(1, 3, 2, 5000, 3000);
49 qDebug();
50}
static PrecisionPtr getPpmInstance(pappso_double value)
get a ppm precision pointer
Definition: precision.cpp:154
pappso::TraceDetectionInterfaceCstSPtr mcsp_traceDetectionInterfaceCstSPtr
the peak detection method for this quantification
void setXicFilter(const pappso::FilterNameInterfaceSPtr &filter)
double m_isotopeMinimumRatio
the minimum percentage of theoretical intensity of the isotope pattern to compute

References pappso::PrecisionFactory::getPpmInstance(), m_isotopeMinimumRatio, mcsp_traceDetectionInterfaceCstSPtr, mp_xicExtractionLowerPrecisionPtr, mp_xicExtractionUppersPrecisionPtr, and setXicFilter().

◆ QuantificationMethod() [2/2]

pappso::masschroq::QuantificationMethod::QuantificationMethod ( const QuantificationMethod other)

Definition at line 52 of file quantificationmethod.cpp.

54 : m_id(other.m_id)
55{
56 m_isotopeMinimumRatio = other.m_isotopeMinimumRatio;
57 m_matchBetweenRun = other.m_matchBetweenRun;
58 m_xicExtractMethod = other.m_xicExtractMethod;
59 m_xicFilterSuite = other.m_xicFilterSuite;
60 mcsp_traceDetectionInterfaceCstSPtr = other.mcsp_traceDetectionInterfaceCstSPtr;
61 mp_xicExtractionLowerPrecisionPtr = other.mp_xicExtractionLowerPrecisionPtr;
62 mp_xicExtractionUppersPrecisionPtr = other.mp_xicExtractionUppersPrecisionPtr;
63 m_xicExtractionRetentionTimeAroundTarget = other.m_xicExtractionRetentionTimeAroundTarget;
64}
pappso::FilterSuiteStringSPtr m_xicFilterSuite
the xic filters
double m_xicExtractionRetentionTimeAroundTarget
set the retention time range in seconds around the target rt

References m_isotopeMinimumRatio, m_matchBetweenRun, m_xicExtractionRetentionTimeAroundTarget, m_xicExtractMethod, m_xicFilterSuite, mcsp_traceDetectionInterfaceCstSPtr, mp_xicExtractionLowerPrecisionPtr, and mp_xicExtractionUppersPrecisionPtr.

◆ ~QuantificationMethod()

pappso::masschroq::QuantificationMethod::~QuantificationMethod ( )
virtual

Destructor

Definition at line 67 of file quantificationmethod.cpp.

68{
69}

Member Function Documentation

◆ addXicFilter()

void pappso::masschroq::QuantificationMethod::addXicFilter ( const pappso::FilterNameInterfaceSPtr filter)

Definition at line 118 of file quantificationmethod.cpp.

119{
120 if(m_xicFilterSuite.get() == nullptr)
121 {
122 m_xicFilterSuite = std::make_shared<pappso::FilterSuiteString>(filter.get()->toString());
123 }
124 else
125 {
126 m_xicFilterSuite.get()->addFilter(filter);
127 }
128}
@ filter
concerning filters (psm, peptide, protein validation)

References pappso::filter.

◆ getFilterSuiteStringSPtr()

const pappso::FilterSuiteStringSPtr & pappso::masschroq::QuantificationMethod::getFilterSuiteStringSPtr ( ) const

Definition at line 131 of file quantificationmethod.cpp.

132{
133 return m_xicFilterSuite;
134}

◆ getId()

const QString & pappso::masschroq::QuantificationMethod::getId ( ) const

Definition at line 72 of file quantificationmethod.cpp.

73{
74 return m_id;
75}

◆ getIsotopeMinimumRatio()

double pappso::masschroq::QuantificationMethod::getIsotopeMinimumRatio ( ) const

Definition at line 105 of file quantificationmethod.cpp.

106{
108}

◆ getJsonObject()

QJsonObject pappso::masschroq::QuantificationMethod::getJsonObject ( ) const

Definition at line 282 of file quantificationmethod.cpp.

283{
284 QJsonObject method;
285
286 qDebug();
287
288 QString xic_type = Utils::enumToString(m_xicExtractMethod);
289
291 {
293 "mp_xicExtractionUppersPrecisionPtr == "
294 "nullptr");
295 }
297 {
299 "mp_xicExtractionLowerPrecisionPtr == "
300 "nullptr");
301 }
302 qDebug();
303 QJsonObject precision;
304 precision.insert("unit", Utils::enumToString(mp_xicExtractionUppersPrecisionPtr->unit()));
305 precision.insert("down", mp_xicExtractionLowerPrecisionPtr->getNominal());
306 precision.insert("up", mp_xicExtractionUppersPrecisionPtr->getNominal());
307
308
309 QJsonObject extraction;
310 extraction.insert("integration", xic_type);
311 extraction.insert("precision", precision);
312
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);
317
318 // xic_filters
319
320 if(m_xicFilterSuite.get() == nullptr)
321 {
323 "m_xicFilterSuite.get() == "
324 "nullptr");
325 }
326 method.insert("pre_filter", m_xicFilterSuite.get()->toString());
327
328
329 const pappso::TraceDetectionZivy *detection_zivy =
331
332 if(detection_zivy == nullptr)
333 {
335 "m_quantificationMethod.getTraceDetectionInterfaceCstSPtr().get() == "
336 "nullptr");
337 }
338
339 QJsonObject detection;
340 detection.insert("type", "zivy");
341 detection.insert("meanfilter", (int)detection_zivy->getSmoothingHalfEdgeWindows());
342 detection.insert("minmax", (int)detection_zivy->getMinMaxHalfEdgeWindows());
343 detection.insert("maxmin", (int)detection_zivy->getMaxMinHalfEdgeWindows());
344 detection.insert("threshold_on_max", detection_zivy->getDetectionThresholdOnMinmax());
345 detection.insert("threshold_on_min", detection_zivy->getDetectionThresholdOnMaxmin());
346 method.insert("detection", detection);
347
348
349 return method;
350}
virtual pappso_double getNominal() const final
Definition: precision.cpp:72
virtual PrecisionUnit unit() const =0
unsigned int getMinMaxHalfEdgeWindows() const
unsigned int getSmoothingHalfEdgeWindows() const
double getDetectionThresholdOnMinmax() const
double getDetectionThresholdOnMaxmin() const
unsigned int getMaxMinHalfEdgeWindows() const
const pappso::TraceDetectionInterfaceCstSPtr & getTraceDetectionInterfaceCstSPtr() const
static QString enumToString(PeakQualityCategory peak_category)
Convenience function to return a string describing the specglob alingment type.
Definition: utils.cpp:44

References pappso::masschroq::Utils::enumToString(), pappso::TraceDetectionZivy::getDetectionThresholdOnMaxmin(), pappso::TraceDetectionZivy::getDetectionThresholdOnMinmax(), pappso::TraceDetectionZivy::getMaxMinHalfEdgeWindows(), pappso::TraceDetectionZivy::getMinMaxHalfEdgeWindows(), and pappso::TraceDetectionZivy::getSmoothingHalfEdgeWindows().

◆ getMatchBetweenRun()

bool pappso::masschroq::QuantificationMethod::getMatchBetweenRun ( ) const

Definition at line 90 of file quantificationmethod.cpp.

91{
92 return m_matchBetweenRun;
93}

◆ getProjectParameters()

pappso::ProjectParameters pappso::masschroq::QuantificationMethod::getProjectParameters ( ) const

Definition at line 207 of file quantificationmethod.cpp.

208{
209 pappso::ProjectParameters parameters;
210
211 pappso::ProjectParam project_param(
213 // xic_type="max"
214 project_param.name = "mcq_xic_extraction_type";
215 project_param.value.setValue(pappso::masschroq::Utils::enumToString(m_xicExtractMethod));
216 parameters.setProjectParam(project_param);
217
218 project_param.name = "mcq_mbr";
219 project_param.value.setValue(getMatchBetweenRun());
220 parameters.setProjectParam(project_param);
221
222 project_param.name = "mcq_isotope_minimum_ratio";
223 project_param.value.setValue(getIsotopeMinimumRatio());
224 parameters.setProjectParam(project_param);
225
226
228 {
229
230 //<!--For XIC extraction on Da use: mz_range-->
231 //<ppm_range min="10" max="10"/>
232
233 project_param.name = "mcq_xic_ppm_range_min";
234 project_param.value.setValue(mp_xicExtractionLowerPrecisionPtr->getNominal());
235 parameters.setProjectParam(project_param);
236
237 project_param.name = "mcq_xic_ppm_range_max";
238 project_param.value.setValue(mp_xicExtractionUppersPrecisionPtr->getNominal());
239 parameters.setProjectParam(project_param);
240 }
242 {
243
244 //<!--For XIC extraction on Da use: mz_range-->
245 //<ppm_range min="10" max="10"/>
246
247 project_param.name = "mcq_xic_mz_range_min";
248 project_param.value.setValue(mp_xicExtractionLowerPrecisionPtr->getNominal());
249 parameters.setProjectParam(project_param);
250
251 project_param.name = "mcq_xic_mz_range_max";
252 project_param.value.setValue(mp_xicExtractionUppersPrecisionPtr->getNominal());
253 parameters.setProjectParam(project_param);
254 }
255
256 project_param.name = "mcq_xic_pre_filter";
257 if(m_xicFilterSuite.get() != nullptr)
258 project_param.value.setValue(m_xicFilterSuite.get()->toString());
259 else
260 project_param.value.setValue("");
261 parameters.setProjectParam(project_param);
262
263
264 const pappso::TraceDetectionZivy *detection_zivy =
266
267 if(detection_zivy != nullptr)
268 {
269 project_param.name = "mcq_detection_zivy";
270 project_param.value.setValue(QString("%1 %2 %3 %4 %5")
271 .arg(detection_zivy->getSmoothingHalfEdgeWindows())
272 .arg(detection_zivy->getMinMaxHalfEdgeWindows())
273 .arg(detection_zivy->getMaxMinHalfEdgeWindows())
274 .arg(detection_zivy->getDetectionThresholdOnMinmax())
275 .arg(detection_zivy->getDetectionThresholdOnMaxmin()));
276 parameters.setProjectParam(project_param);
277 }
278 return parameters;
279}
void setProjectParam(const ProjectParam &param)
@ quantification
quantification

References pappso::dalton, pappso::masschroq::Utils::enumToString(), pappso::TraceDetectionZivy::getDetectionThresholdOnMaxmin(), pappso::TraceDetectionZivy::getDetectionThresholdOnMinmax(), pappso::TraceDetectionZivy::getMaxMinHalfEdgeWindows(), pappso::TraceDetectionZivy::getMinMaxHalfEdgeWindows(), pappso::TraceDetectionZivy::getSmoothingHalfEdgeWindows(), pappso::ProjectParam::name, pappso::ppm, pappso::quantification, and pappso::ProjectParameters::setProjectParam().

◆ getTraceDetectionInterfaceCstSPtr()

const pappso::TraceDetectionInterfaceCstSPtr & pappso::masschroq::QuantificationMethod::getTraceDetectionInterfaceCstSPtr ( ) const

Definition at line 201 of file quantificationmethod.cpp.

202{
204}

◆ getXicExtractionLowerPrecisionPtr()

pappso::PrecisionPtr pappso::masschroq::QuantificationMethod::getXicExtractionLowerPrecisionPtr ( ) const

Definition at line 441 of file quantificationmethod.cpp.

442{
444}

◆ getXicExtractionMeanPrecisionPtr()

pappso::PrecisionPtr pappso::masschroq::QuantificationMethod::getXicExtractionMeanPrecisionPtr ( ) const

◆ getXicExtractionMzRange()

const pappso::MzRange pappso::masschroq::QuantificationMethod::getXicExtractionMzRange ( double  mz) const

◆ getXicExtractionRtRange()

double pappso::masschroq::QuantificationMethod::getXicExtractionRtRange ( ) const

Definition at line 78 of file quantificationmethod.cpp.

◆ getXicExtractionUppersPrecisionPtr()

pappso::PrecisionPtr pappso::masschroq::QuantificationMethod::getXicExtractionUppersPrecisionPtr ( ) const

Definition at line 447 of file quantificationmethod.cpp.

448{
450}

◆ getXicExtractMethod()

pappso::XicExtractMethod pappso::masschroq::QuantificationMethod::getXicExtractMethod ( ) const

Definition at line 155 of file quantificationmethod.cpp.

156{
157 return m_xicExtractMethod;
158}

◆ getXicFilter()

const pappso::FilterNameInterfaceSPtr pappso::masschroq::QuantificationMethod::getXicFilter ( ) const

Definition at line 188 of file quantificationmethod.cpp.

189{
190 return m_xicFilterSuite;
191}

◆ setIsotopeMinimumRatio()

void pappso::masschroq::QuantificationMethod::setIsotopeMinimumRatio ( double  ratio)

Definition at line 96 of file quantificationmethod.cpp.

97{
98 if((ratio < 1) && (ratio >= 0))
99 {
100 m_isotopeMinimumRatio = ratio;
101 }
102}

◆ setJsonObject()

void pappso::masschroq::QuantificationMethod::setJsonObject ( const QJsonObject &  json_object)

Definition at line 353 of file quantificationmethod.cpp.

354{
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();
358
359 qDebug() << filter_str;
360 if(!filter_str.isEmpty())
361 {
363 std::make_shared<pappso::FilterSuiteString>(filter_str);
364 addXicFilter(filter_sp);
365 qDebug() << filter_str;
366 }
367 QJsonObject extraction = quantification_method.value("extraction").toObject();
368
369 QJsonValue rt_range = extraction.value("rt_range");
370 if(!rt_range.isUndefined())
371 {
372 setXicExtractionRtRange(rt_range.toDouble());
373 }
374
375 QString integration = extraction.value("integration").toString();
376 if(integration == "sum")
377 {
379 }
380 else if(integration == "max")
381 {
383 }
384 else
385 {
387 QObject::tr("missing "
388 "masschroq_methods>quantification_method>extraction>"
389 "integration %1 value")
390 .arg(integration));
391 }
392
393 QJsonObject precision = extraction.value("precision").toObject();
394 qDebug() << precision.value("down").toDouble();
395 qDebug() << precision.value("up").toDouble();
396
397 if(precision.value("unit").toString() == "dalton")
398 {
400 pappso::PrecisionFactory::getDaltonInstance(precision.value("down").toDouble()));
402 pappso::PrecisionFactory::getDaltonInstance(precision.value("up").toDouble()));
403 }
404 else if(precision.value("unit").toString() == "ppm")
405 {
407 pappso::PrecisionFactory::getPpmInstance(precision.value("down").toDouble()));
409 pappso::PrecisionFactory::getPpmInstance(precision.value("up").toDouble()));
410 }
411 else
412 {
414 QObject::tr("missing "
415 "masschroq_methods>quantification_method>extraction>precision>"
416 "unit"));
417 }
418
419
420 QJsonObject detection = quantification_method.value("detection").toObject();
421 if(detection.value("type").toString() == "zivy")
422 {
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);
430 }
431 else
432 {
433
435 QObject::tr("only masschroq_methods>quantification_method>detection>type == zivy "
436 "allowed"));
437 }
438}
void setXicExtractMethod(pappso::XicExtractMethod method)
void setXicExtractionUpperPrecisionPtr(pappso::PrecisionPtr precision)
void addXicFilter(const pappso::FilterNameInterfaceSPtr &filter)
void setXicExtractionLowerPrecisionPtr(pappso::PrecisionPtr precision)
void setTraceDetectionInterfaceCstSPtr(const pappso::TraceDetectionInterfaceCstSPtr &detection)
std::shared_ptr< FilterNameInterface > FilterNameInterfaceSPtr
@ sum
sum of intensities
@ max
maximum of intensities

References pappso::PrecisionFactory::getDaltonInstance(), pappso::PrecisionFactory::getPpmInstance(), pappso::max, and pappso::sum.

◆ setMatchBetweenRun()

void pappso::masschroq::QuantificationMethod::setMatchBetweenRun ( bool  is_match)

Definition at line 453 of file quantificationmethod.cpp.

454{
455 m_matchBetweenRun = is_match;
456}

◆ setTraceDetectionInterfaceCstSPtr()

void pappso::masschroq::QuantificationMethod::setTraceDetectionInterfaceCstSPtr ( const pappso::TraceDetectionInterfaceCstSPtr detection)

Definition at line 161 of file quantificationmethod.cpp.

163{
165}

◆ setXicExtractionLowerPrecisionPtr()

void pappso::masschroq::QuantificationMethod::setXicExtractionLowerPrecisionPtr ( pappso::PrecisionPtr  precision)

Definition at line 168 of file quantificationmethod.cpp.

170{
172}

◆ setXicExtractionRtRange()

void pappso::masschroq::QuantificationMethod::setXicExtractionRtRange ( double  rt_range)

Definition at line 84 of file quantificationmethod.cpp.

◆ setXicExtractionUpperPrecisionPtr()

void pappso::masschroq::QuantificationMethod::setXicExtractionUpperPrecisionPtr ( pappso::PrecisionPtr  precision)

Definition at line 175 of file quantificationmethod.cpp.

177{
179}

◆ setXicExtractMethod()

void pappso::masschroq::QuantificationMethod::setXicExtractMethod ( pappso::XicExtractMethod  method)

Definition at line 182 of file quantificationmethod.cpp.

183{
184 m_xicExtractMethod = method;
185}

◆ setXicFilter()

void pappso::masschroq::QuantificationMethod::setXicFilter ( const pappso::FilterNameInterfaceSPtr filter)

Definition at line 111 of file quantificationmethod.cpp.

112{
113 m_xicFilterSuite = std::make_shared<pappso::FilterSuiteString>(filter.get()->toString());
114}

References pappso::filter.

Referenced by QuantificationMethod().

Member Data Documentation

◆ m_id

const QString pappso::masschroq::QuantificationMethod::m_id
private

Definition at line 114 of file quantificationmethod.h.

◆ m_isotopeMinimumRatio

double pappso::masschroq::QuantificationMethod::m_isotopeMinimumRatio = 0
private

the minimum percentage of theoretical intensity of the isotope pattern to compute

Definition at line 144 of file quantificationmethod.h.

Referenced by QuantificationMethod().

◆ m_matchBetweenRun

bool pappso::masschroq::QuantificationMethod::m_matchBetweenRun = true
private

Definition at line 139 of file quantificationmethod.h.

Referenced by QuantificationMethod().

◆ m_xicExtractionRetentionTimeAroundTarget

double pappso::masschroq::QuantificationMethod::m_xicExtractionRetentionTimeAroundTarget = 300
private

set the retention time range in seconds around the target rt

only the interesting part of the xic will be extracted, form the rt target

  • range_in_seconds to rt target + range in seconds by default, all the LC run time is extracted
Parameters
range_in_secondsrange in seconds

Definition at line 129 of file quantificationmethod.h.

Referenced by QuantificationMethod().

◆ m_xicExtractMethod

pappso::XicExtractMethod pappso::masschroq::QuantificationMethod::m_xicExtractMethod = pappso::XicExtractMethod::max
private

Definition at line 115 of file quantificationmethod.h.

Referenced by QuantificationMethod().

◆ m_xicFilterSuite

pappso::FilterSuiteStringSPtr pappso::masschroq::QuantificationMethod::m_xicFilterSuite
private

the xic filters

Definition at line 133 of file quantificationmethod.h.

Referenced by QuantificationMethod().

◆ mcsp_traceDetectionInterfaceCstSPtr

pappso::TraceDetectionInterfaceCstSPtr pappso::masschroq::QuantificationMethod::mcsp_traceDetectionInterfaceCstSPtr
private

the peak detection method for this quantification

Definition at line 137 of file quantificationmethod.h.

Referenced by QuantificationMethod().

◆ mp_xicExtractionLowerPrecisionPtr

pappso::PrecisionPtr pappso::masschroq::QuantificationMethod::mp_xicExtractionLowerPrecisionPtr = nullptr
private

Definition at line 117 of file quantificationmethod.h.

Referenced by QuantificationMethod().

◆ mp_xicExtractionUppersPrecisionPtr

pappso::PrecisionPtr pappso::masschroq::QuantificationMethod::mp_xicExtractionUppersPrecisionPtr = nullptr
private

Definition at line 118 of file quantificationmethod.h.

Referenced by QuantificationMethod().


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