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

Method convertModificationSet_

src/openms/source/FORMAT/XTandemInfile.cpp:65–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63 }
64
65 String XTandemInfile::convertModificationSet_(const set<ModificationDefinition>& mods, map<String, double>& affected_origins) const
66 {
67 // check if both "Glu->pyro-Glu (N-term E)" and "Gln->pyro-Glu (N-term Q)"
68 // are specified:
69 bool has_pyroglu_e = false, has_pyroglu_q = false;
70 for (set<ModificationDefinition>::const_iterator it = mods.begin();
71 it != mods.end(); ++it)
72 {
73 if (it->getModificationName() == "Glu->pyro-Glu (N-term E)")
74 {
75 has_pyroglu_e = true;
76 }
77 else if (it->getModificationName() == "Gln->pyro-Glu (N-term Q)")
78 {
79 has_pyroglu_q = true;
80 }
81 if (has_pyroglu_e && has_pyroglu_q)
82 {
83 break;
84 }
85 }
86
87 map<String, double> origin_set;
88 StringList xtandem_mods;
89 for (set<ModificationDefinition>::const_iterator it = mods.begin();
90 it != mods.end(); ++it)
91 {
92 if (!force_default_mods_ &&
93 // @TODO: change Acetyl spec. to "protein N-term" once it's supported
94 ((it->getModificationName() == "Acetyl (N-term)") ||
95 // for the pyro-Glus, only skip if both are present:
96 ((it->getModificationName() == "Gln->pyro-Glu (N-term Q)") &&
97 has_pyroglu_e) ||
98 ((it->getModificationName() == "Glu->pyro-Glu (N-term E)") &&
99 has_pyroglu_q)))
100 {
101 continue;
102 }
103
104 double mod_mass = it->getModification().getDiffMonoMass();
105
106 String orig = it->getModification().getOrigin();
107 ResidueModification::TermSpecificity ts = it->getModification().getTermSpecificity();
108 if ((ts != ResidueModification::ANYWHERE) && !orig.empty())
109 {
110 OPENMS_LOG_WARN << "Warning: X! Tandem doesn't support modifications with both residue and terminal specificity. Using only terminal specificity for modification '" << it->getModificationName() << "'." << endl;
111 }
112
113 if (ts == ResidueModification::C_TERM)
114 {
115 orig = "]";
116 }
117 else if (ts == ResidueModification::N_TERM)
118 {
119 orig = "[";
120 }
121 // check double usage
122 if (origin_set.find(orig) != origin_set.end())

Callers

nothing calls this directly

Calls 13

concatenateFunction · 0.85
getModificationNameMethod · 0.80
getDiffMonoMassMethod · 0.80
StringClass · 0.50
beginMethod · 0.45
endMethod · 0.45
getModificationMethod · 0.45
getOriginMethod · 0.45
getTermSpecificityMethod · 0.45
emptyMethod · 0.45
findMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected