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

Method lookupAddFromHeader_

src/openms/source/FORMAT/PepXMLFile.cpp:1973–1993  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1971 }
1972
1973 bool PepXMLFile::lookupAddFromHeader_(double modification_mass,
1974 Size modification_position,
1975 vector<AminoAcidModification> const& header_mods)
1976 {
1977 bool found = false;
1978 for (const auto& m : header_mods)
1979 {
1980 //TODO do we really want to allow another tolerance to the masses in the header?
1981 if (fabs(modification_mass - m.getMass()) < mod_tol_)
1982 {
1983 if (m.getAminoAcid().hasSubstring(current_sequence_[modification_position]))
1984 {
1985 current_modifications_
1986 .emplace_back(m.getRegisteredMod(), modification_position); // position not needed for terminus
1987 found = true;
1988 break; // only one modification should match, so we can stop the loop here
1989 }
1990 }
1991 }
1992 return found;
1993 }
1994
1995 void PepXMLFile::endElement(const XMLCh* const /*uri*/,
1996 const XMLCh* const /*local_name*/,

Callers

nothing calls this directly

Calls 4

hasSubstringMethod · 0.80
emplace_backMethod · 0.80
getRegisteredModMethod · 0.80
getMassMethod · 0.45

Tested by

no test coverage detected