MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / queryByFeature

Method queryByFeature

src/openms/source/ANALYSIS/ID/AccurateMassSearchEngine.cpp:437–477  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

435 }
436
437 void AccurateMassSearchEngine::queryByFeature(const Feature& feature, const Size& feature_index, const String& ion_mode, std::vector<AccurateMassSearchResult>& results) const
438 {
439 if (!is_initialized_)
440 {
441 throw Exception::IllegalArgument(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "AccurateMassSearchEngine::init() was not called!");
442 }
443
444 std::vector<AccurateMassSearchResult> results_part;
445
446 bool use_feature_adducts = param_.getValue("use_feature_adducts").toString() == "true";
447 if (use_feature_adducts && feature.metaValueExists(Constants::UserParam::DC_CHARGE_ADDUCTS))
448 {
449 queryByMZ(feature.getMZ(), feature.getCharge(), ion_mode, results_part, EmpiricalFormula(feature.getMetaValue(Constants::UserParam::DC_CHARGE_ADDUCTS)));
450 }
451 else
452 {
453 queryByMZ(feature.getMZ(), feature.getCharge(), ion_mode, results_part);
454 }
455
456 bool isotope_export = param_.getValue("mzTab:exportIsotopeIntensities").toString() == "true";
457
458 for (Size hit_idx = 0; hit_idx < results_part.size(); ++hit_idx)
459 {
460 results_part[hit_idx].setObservedRT(feature.getRT());
461 results_part[hit_idx].setSourceFeatureIndex(feature_index);
462 results_part[hit_idx].setObservedIntensity(feature.getIntensity());
463
464 std::vector<double> mti;
465 if (isotope_export)
466 {
467 if (feature.metaValueExists("masstrace_intensity"))
468 {
469 mti = feature.getMetaValue("masstrace_intensity");
470 }
471 results_part[hit_idx].setMasstraceIntensities(mti);
472 }
473
474 // append
475 results.push_back(results_part[hit_idx]);
476 }
477 }
478
479 void AccurateMassSearchEngine::queryByConsensusFeature(const ConsensusFeature& cfeat, const Size& cf_index, const Size& number_of_maps, const String& ion_mode, std::vector<AccurateMassSearchResult>& results) const
480 {

Calls 15

metaValueExistsMethod · 0.80
getMetaValueMethod · 0.80
setObservedRTMethod · 0.80
setSourceFeatureIndexMethod · 0.80
setObservedIntensityMethod · 0.80
EmpiricalFormulaFunction · 0.50
toStringMethod · 0.45
getValueMethod · 0.45
getMZMethod · 0.45
getChargeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected