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

Method startElement

src/openms/source/FORMAT/IdXMLFile.cpp:436–826  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

434 }
435
436 void IdXMLFile::startElement(const XMLCh* const /*uri*/, const XMLCh* const /*local_name*/, const XMLCh* const qname, const xercesc::Attributes& attributes)
437 {
438 String tag = sm_.convert(qname);
439
440 //START
441 if (tag == "IdXML")
442 {
443 //check file version against schema version
444 String file_version = "";
445 prot_id_in_run_ = false;
446
447 optionalAttributeAsString_(file_version, attributes, "version");
448 if (file_version.empty())
449 {
450 file_version = "1.0"; //default version is 1.0
451 }
452 if (file_version.toDouble() > version_.toDouble())
453 {
454 warning(LOAD, "The XML file (" + file_version + ") is newer than the parser (" + version_ + "). This might lead to undefined program behavior.");
455 }
456
457 //document id
458 String document_id = "";
459 optionalAttributeAsString_(document_id, attributes, "id");
460 (*document_id_) = document_id;
461 }
462 //SEARCH PARAMETERS
463 else if (tag == "SearchParameters")
464 {
465 //store id
466 id_ = attributeAsString_(attributes, "id");
467
468 //reset parameters
469 param_ = ProteinIdentification::SearchParameters();
470
471 //load parameters
472 param_.db = attributeAsString_(attributes, "db");
473 param_.db_version = attributeAsString_(attributes, "db_version");
474
475 optionalAttributeAsString_(param_.taxonomy, attributes, "taxonomy");
476 param_.charges = attributeAsString_(attributes, "charges");
477 optionalAttributeAsUInt_(param_.missed_cleavages, attributes, "missed_cleavages");
478 param_.fragment_mass_tolerance = attributeAsDouble_(attributes, "peak_mass_tolerance");
479
480 String peak_unit;
481 optionalAttributeAsString_(peak_unit, attributes, "peak_mass_tolerance_ppm");
482 param_.fragment_mass_tolerance_ppm = peak_unit == "true" ? true : false;
483
484 param_.precursor_mass_tolerance = attributeAsDouble_(attributes, "precursor_peak_tolerance");
485 String precursor_unit;
486 optionalAttributeAsString_(precursor_unit, attributes, "precursor_peak_tolerance_ppm");
487 param_.precursor_mass_tolerance_ppm = precursor_unit == "true" ? true : false;
488
489 //mass type
490 String mass_type = attributeAsString_(attributes, "mass_type");
491 if (mass_type == "monoisotopic")
492 {
493 param_.mass_type = ProteinIdentification::MONOISOTOPIC;

Callers

nothing calls this directly

Calls 15

attributeAsString_Function · 0.85
SearchParametersFunction · 0.85
optionalAttributeAsUInt_Function · 0.85
attributeAsDouble_Function · 0.85
getInstanceFunction · 0.85
getUniqueIdFunction · 0.85
asBool_Function · 0.85
attributeAsInt_Function · 0.85
attributeAsIntList_Function · 0.85
attributeAsDoubleList_Function · 0.85

Tested by

no test coverage detected