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

Method handleUserParam_

src/openms/source/FORMAT/HANDLERS/MzQuantMLHandler.cpp:628–688  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

626 }
627
628 void MzQuantMLHandler::handleUserParam_(const String& parent_parent_tag, const String& parent_tag, const String& name, const String& type, const String& value)
629 {
630 // create a DataValue that contains the data in the right type
631 DataValue data_value = fromXSDString(type, value);
632
633 if (parent_parent_tag.empty())
634 {
635 //~ TODO: dummy
636 warning(LOAD, String("The user param '") + name + "' used in tag '" + parent_tag + "' has no valid grand parent.'");
637 }
638 //find the right MetaInfoInterface
639 if (parent_tag == "ProcessingMethod")
640 {
641 //~ value is softwarename - will get handled elsewhere
642 int x = std::distance(DataProcessing::NamesOfProcessingAction, std::find(DataProcessing::NamesOfProcessingAction, DataProcessing::NamesOfProcessingAction + DataProcessing::SIZE_OF_PROCESSINGACTION, name));
643 DataProcessing::ProcessingAction a = static_cast<DataProcessing::ProcessingAction>(x); // ugly and depends on NamesOfProcessingAction^=ProcessingAction-definitions - see TODO rewrite DataProcessing!
644 current_pas_.insert(a);
645 }
646 else if (parent_tag == "Software")
647 {
648 if (value.empty())
649 {
650 current_sws_[current_id_].setName(name);
651 }
652 else
653 {
654 current_sws_[current_id_].setMetaValue(name, data_value);
655 }
656 }
657 else if (parent_tag == "AnalysisSummary")
658 {
659 if (name == "QuantType")
660 {
661 const std::string* match = std::find(MSQuantifications::NamesOfQuantTypes, MSQuantifications::NamesOfQuantTypes + MSQuantifications::SIZE_OF_QUANT_TYPES, value);
662 int i = (MSQuantifications::NamesOfQuantTypes + MSQuantifications::SIZE_OF_QUANT_TYPES == match) ? -1 : std::distance(MSQuantifications::NamesOfQuantTypes, match);
663 MSQuantifications::QUANT_TYPES quant_type = static_cast<MSQuantifications::QUANT_TYPES>(i); //this is so not nice and soooo unsafe why enum in the first place?!
664 msq_->setAnalysisSummaryQuantType(quant_type);
665 }
666 else
667 {
668 msq_->getAnalysisSummary().user_params_.setValue(name, data_value);
669 }
670 }
671 else if (parent_tag == "RatioCalculation")
672 {
673 r_rtemp_[current_id_].description_.push_back(name);
674 }
675 else if (parent_tag == "Feature")
676 {
677 if (name == "feature_index")
678 {
679 f_f_obj_[current_id_].setUniqueId(UInt64(value.toInt()));
680 }
681 else if (name == "map_index")
682 {
683 f_f_obj_[current_id_].setMapIndex(UInt64(value.toInt()));
684 }
685 }

Callers

nothing calls this directly

Calls 12

fromXSDStringFunction · 0.85
setUniqueIdMethod · 0.80
toIntMethod · 0.80
setMapIndexMethod · 0.80
StringClass · 0.50
emptyMethod · 0.45
insertMethod · 0.45
setNameMethod · 0.45
setMetaValueMethod · 0.45
setValueMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected