| 237 | } |
| 238 | |
| 239 | String modifyNTermAASpecificSequence_(const String& seq) |
| 240 | { |
| 241 | String swap; |
| 242 | string modifiedSequence = seq; |
| 243 | vector<pair<String, char> > massShiftList; |
| 244 | |
| 245 | massShiftList.push_back(make_pair("-18.011", 'E')); |
| 246 | massShiftList.push_back(make_pair("-17.027", 'Q')); |
| 247 | |
| 248 | for (vector<pair<String, char> >::const_iterator it = massShiftList.begin(); it != massShiftList.end(); ++it) |
| 249 | { |
| 250 | string modMassShift = it->first; |
| 251 | size_t found = modifiedSequence.find(modMassShift); |
| 252 | |
| 253 | if (found != string::npos) |
| 254 | { |
| 255 | String tmp = modifiedSequence.substr(0, found + modMassShift.length() + 1); |
| 256 | size_t foundAA = tmp.find_first_of("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); |
| 257 | |
| 258 | if ((foundAA > found) && (tmp[foundAA] == it->second)) // no AA at the begin |
| 259 | { |
| 260 | if (found > 0) |
| 261 | { |
| 262 | swap = modifiedSequence.substr(0, found); |
| 263 | } |
| 264 | return swap += *tmp.rbegin() + modMassShift + modifiedSequence.substr(found + modMassShift.length() + 1); |
| 265 | } |
| 266 | } |
| 267 | } |
| 268 | return modifiedSequence; |
| 269 | } |
| 270 | |
| 271 | // Method to replace the mass representation of modifications. |
| 272 | // Modifications in the TSV file have the format 'M+15.999' |