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

Method endElement

src/openms/source/FORMAT/PepXMLFile.cpp:1995–2155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1993 }
1994
1995 void PepXMLFile::endElement(const XMLCh* const /*uri*/,
1996 const XMLCh* const /*local_name*/,
1997 const XMLCh* const qname)
1998 {
1999 String element = sm_.convert(qname);
2000
2001 // cout << "End: " << element << "\n";
2002
2003 if (element == "analysis_summary")
2004 {
2005 analysis_summary_ = false;
2006 }
2007 else if (element == "search_score_summary")
2008 {
2009 search_score_summary_ = false;
2010 }
2011 else if (element == "analysis_result") // parent: "search_hit"
2012 {
2013 peptide_hit_.addAnalysisResults(current_analysis_result_);
2014 }
2015 else if (wrong_experiment_ || analysis_summary_)
2016 {
2017 // do nothing here (skip all elements that belong to the wrong experiment
2018 // or to an analysis summary)
2019 }
2020 else if (element == "spectrum_query")
2021 {
2022 // clear optional attributes
2023 native_spectrum_name_ = "";
2024 experiment_label_ = "";
2025 swath_assay_ = "";
2026 status_ = "";
2027 }
2028 else if (element == "search_hit")
2029 {
2030 AASequence temp_aa_sequence = AASequence::fromString(current_sequence_);
2031
2032 //Note: using our AASequence::fromString on the modified_sequence of
2033 // the modification_info element is probably not possible since modifications may have special
2034 // symbols that we would need to save and lookup additionally
2035 //TODO one might argue that mods from XML attributes are better specified and should be preferred
2036
2037 // Modifications explicitly annotated at the current search_hit take preference over
2038 // implicit fixed mods
2039 //TODO use peptide_hit_.getPeptideEvidences().back().getAAAfter()/Before() to see if Protein term is applicable at all
2040 // But: Leave it out for now since I bet there is software out there, not adhering to the specification
2041 for (const auto& mod : current_modifications_)
2042 {
2043 if (mod.first->getTermSpecificity() == ResidueModification::N_TERM ||
2044 mod.first->getTermSpecificity() == ResidueModification::PROTEIN_N_TERM)
2045 {
2046 if (!temp_aa_sequence.hasNTerminalModification())
2047 {
2048 temp_aa_sequence.setNTerminalModification(mod.first);
2049 }
2050 else
2051 {
2052 warning(LOAD, "Multiple N-term mods specified for search_hit with sequence " + current_sequence_

Callers

nothing calls this directly

Calls 15

getInstanceFunction · 0.85
addAnalysisResultsMethod · 0.80
getRegisteredModMethod · 0.80
hasSubstringMethod · 0.80
getModifiedResidueMethod · 0.80
setTimeMethod · 0.80
setSearchParametersMethod · 0.80
backMethod · 0.80

Tested by

no test coverage detected