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

Method parseMod_

src/openms/source/CHEMISTRY/NASequence.cpp:414–444  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

412 }
413
414 String::ConstIterator NASequence::parseMod_(const String::ConstIterator str_it, const String& str, NASequence& nas)
415 {
416 static RibonucleotideDB* rdb = RibonucleotideDB::getInstance();
417 OPENMS_PRECONDITION(*str_it == '[', "Modification must start with '['.");
418 String::ConstIterator mod_start(str_it);
419 String::ConstIterator mod_end(++mod_start);
420 while ((mod_end != str.end()) && (*mod_end != ']'))
421 {
422 ++mod_end; // advance to closing bracket
423 }
424 string mod(mod_start, mod_end);
425 if (mod_end == str.end())
426 {
427 throw Exception::ParseError(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, str, "Cannot convert string to modified ribonucleotide: missing ']'");
428 }
429 ConstRibonucleotidePtr r = rdb->getRibonucleotide(mod);
430 // @TODO: check if position is actually 5'/3' and there's no mod already
431 if (r->getTermSpecificity() == Ribonucleotide::FIVE_PRIME)
432 {
433 nas.setFivePrimeMod(r);
434 }
435 else if (r->getTermSpecificity() == Ribonucleotide::THREE_PRIME)
436 {
437 nas.setThreePrimeMod(r);
438 }
439 else
440 {
441 nas.seq_.push_back(r);
442 }
443 return mod_end;
444 }
445
446 OPENMS_DLLAPI ostream& operator<<(ostream& os, const NASequence& seq)
447 {

Callers

nothing calls this directly

Calls 7

getInstanceFunction · 0.85
getRibonucleotideMethod · 0.80
setFivePrimeModMethod · 0.80
setThreePrimeModMethod · 0.80
endMethod · 0.45
getTermSpecificityMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected