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

Method endElement

src/openms/source/FORMAT/OMSSAXMLFile.cpp:95–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93 }
94
95 void OMSSAXMLFile::endElement(const XMLCh* const /*uri*/, const XMLCh* const /*local_name*/, const XMLCh* const qname)
96 {
97 tag_ = String(sm_.convert(qname)).trim();
98
99 // protein hits (MSPepHits) are handled in ::characters(...)
100
101 // end of peptide hit
102 if (tag_ == "MSHits")
103 {
104 actual_peptide_hit_.setPeptideEvidences(actual_peptide_evidences_);
105 actual_peptide_evidence_ = PeptideEvidence();
106 actual_peptide_evidences_.clear();
107 actual_peptide_id_.insertHit(actual_peptide_hit_);
108 actual_peptide_hit_ = PeptideHit();
109 }
110 // end of peptide id
111 else if (tag_ == "MSHitSet")
112 {
113 if (!actual_peptide_id_.getHits().empty() || load_empty_hits_)
114 {
115 peptide_identifications_->push_back(actual_peptide_id_);
116 }
117 actual_peptide_id_ = PeptideIdentification();
118 }
119 else if (tag_ == "MSModHit")
120 {
121 /*
122 Modifications:
123 <MSModHit>
124 <MSModHit_site>1</MSModHit_site>
125 <MSModHit_modtype>
126 <MSMod>3</MSMod>
127 </MSModHit_modtype>
128 </MSModHit>
129 */
130 if (mods_map_.find(actual_mod_type_.toInt()) != mods_map_.end() && !mods_map_[actual_mod_type_.toInt()].empty())
131 {
132 if (mods_map_[actual_mod_type_.toInt()].size() > 1)
133 {
134 warning(LOAD, String("Cannot determine exact type of modification of position ") + actual_mod_site_ + " in sequence " + actual_peptide_hit_.getSequence().toString() + " using modification " + actual_mod_type_ + " - using first possibility!");
135 }
136 AASequence pep = actual_peptide_hit_.getSequence();
137 auto mod = *(mods_map_[actual_mod_type_.toInt()].begin());
138 if (mod->getTermSpecificity() == ResidueModification::N_TERM)
139 {
140 pep.setNTerminalModification(mod->getFullId());
141 }
142 else if (mod->getTermSpecificity() == ResidueModification::C_TERM)
143 {
144 pep.setCTerminalModification(mod->getFullId());
145 }
146 else
147 {
148 pep.setModification(actual_mod_site_, mod->getFullId());
149 }
150 actual_peptide_hit_.setSequence(pep);
151 }
152 else

Callers

nothing calls this directly

Calls 15

setPeptideEvidencesMethod · 0.80
toIntMethod · 0.80
getSequenceMethod · 0.80
StringClass · 0.50
PeptideEvidenceFunction · 0.50
PeptideHitClass · 0.50
convertMethod · 0.45
clearMethod · 0.45
insertHitMethod · 0.45

Tested by

no test coverage detected