| 29 | = default; |
| 30 | |
| 31 | void UnimodXMLHandler::startElement(const XMLCh* const /*uri*/, const XMLCh* const /*local_name*/, const XMLCh* const qname, const Attributes& attributes) |
| 32 | { |
| 33 | |
| 34 | tag_ = String(sm_.convert(qname)); |
| 35 | |
| 36 | // new modification? |
| 37 | if (tag_ == "umod:mod" || tag_ == "mod") |
| 38 | { |
| 39 | sites_.clear(); |
| 40 | modification_ = new ResidueModification(); |
| 41 | String title(attributeAsString_(attributes, "title")); |
| 42 | modification_->setId(title); |
| 43 | |
| 44 | String full_name(attributeAsString_(attributes, "full_name")); |
| 45 | // full_name.substitute("®", ""); // remove damn character (will be interpreted differently across platforms) |
| 46 | // deleted this in the unimod.xml file |
| 47 | modification_->setFullName(full_name); |
| 48 | |
| 49 | Int record_id(attributeAsInt_(attributes, "record_id")); |
| 50 | modification_->setUniModRecordId(record_id); |
| 51 | return; |
| 52 | } |
| 53 | |
| 54 | // which residues are allowed? |
| 55 | if (tag_ == "umod:specificity" || tag_ == "specificity") |
| 56 | { |
| 57 | // neutral_loss_diff_formula_ = EmpiricalFormula(); |
| 58 | neutral_loss_diff_formula_.clear(); |
| 59 | |
| 60 | // classification of mod |
| 61 | // TODO do this for all mods, do not overwrite for each specificity |
| 62 | String classification(attributeAsString_(attributes, "classification")); |
| 63 | modification_->setSourceClassification(classification); |
| 64 | |
| 65 | // allowed site |
| 66 | String site = attributeAsString_(attributes, "site"); |
| 67 | //sites_.push_back(site); |
| 68 | |
| 69 | // allowed positions |
| 70 | ResidueModification::TermSpecificity position = ResidueModification::ANYWHERE; |
| 71 | String pos(attributeAsString_(attributes, "position")); |
| 72 | if (pos == "Anywhere") |
| 73 | { |
| 74 | position = ResidueModification::ANYWHERE; |
| 75 | } |
| 76 | else if (pos == "Protein N-term") |
| 77 | { |
| 78 | position = ResidueModification::PROTEIN_N_TERM; |
| 79 | } |
| 80 | else if (pos == "Protein C-term") |
| 81 | { |
| 82 | position = ResidueModification::PROTEIN_C_TERM; |
| 83 | } |
| 84 | else if (pos == "Any C-term") |
| 85 | { |
| 86 | position = ResidueModification::C_TERM; |
| 87 | } |
| 88 | else if (pos == "Any N-term") |
nothing calls this directly
no test coverage detected