remove all modifications which are LuciPHOr2 target modifications, because for these LuciPHOr2 could predict a different position.
| 341 | // remove all modifications which are LuciPHOr2 target modifications, |
| 342 | // because for these LuciPHOr2 could predict a different position. |
| 343 | AASequence removeLuciphorTargetMods_(const AASequence& original_seq, const map<String, String>& target_mods_conv) |
| 344 | { |
| 345 | if (!original_seq.isModified()) { |
| 346 | return original_seq; |
| 347 | } |
| 348 | |
| 349 | AASequence seq_converted = AASequence::fromString(original_seq.toUnmodifiedString()); |
| 350 | |
| 351 | // set C-term/N-term modification |
| 352 | if (original_seq.hasNTerminalModification()) |
| 353 | { |
| 354 | seq_converted.setNTerminalModification(original_seq.getNTerminalModificationName()); |
| 355 | } |
| 356 | if (original_seq.hasCTerminalModification()) |
| 357 | { |
| 358 | seq_converted.setCTerminalModification(original_seq.getCTerminalModificationName()); |
| 359 | } |
| 360 | |
| 361 | // set all modifications, which were not changed by LuciPHOr2 |
| 362 | for (Size i = 0; i < original_seq.size(); ++i) |
| 363 | { |
| 364 | if (original_seq.getResidue(i).isModified()) |
| 365 | { |
| 366 | String mod = original_seq.getResidue(i).getModificationName(); |
| 367 | |
| 368 | // no target modification, modification can be set |
| 369 | bool found = false; |
| 370 | for (map<String, String>::const_iterator iter = target_mods_conv.begin(); iter != target_mods_conv.end() && !found; ++iter) |
| 371 | { |
| 372 | if (mod == iter->second) |
| 373 | { |
| 374 | found = true; |
| 375 | } |
| 376 | } |
| 377 | if (!found) |
| 378 | { |
| 379 | seq_converted.setModification(i, mod); |
| 380 | } |
| 381 | } |
| 382 | } |
| 383 | return seq_converted; |
| 384 | } |
| 385 | |
| 386 | // set modifications changed by LuciPHOr2 |
| 387 | ExitCodes setLuciphorTargetMods_(AASequence& seq, String seq_luciphor, const map<String, String>& target_mods_conv) |
nothing calls this directly
no test coverage detected