| 122 | } |
| 123 | |
| 124 | void PepXMLFileMascot::endElement(const XMLCh * const /*uri*/, const XMLCh * const /*local_name*/, const XMLCh * const qname) |
| 125 | { |
| 126 | String element = sm_.convert(qname); |
| 127 | |
| 128 | ///SEARCH PARAMETERS |
| 129 | if (element == "search_hit") |
| 130 | { |
| 131 | AASequence temp_aa_sequence = AASequence::fromString(actual_sequence_); |
| 132 | |
| 133 | // modification position is 1-based |
| 134 | for (vector<pair<String, UInt> >::const_iterator it = actual_modifications_.begin(); it != actual_modifications_.end(); ++it) |
| 135 | { |
| 136 | // e.g. Carboxymethyl (C) |
| 137 | vector<String> mod_split; |
| 138 | it->first.split(' ', mod_split); |
| 139 | if (it->first.hasSubstring("C-term")) |
| 140 | { |
| 141 | temp_aa_sequence.setCTerminalModification(it->first); |
| 142 | } |
| 143 | else if (it->first.hasSubstring("N-term")) |
| 144 | { |
| 145 | temp_aa_sequence.setNTerminalModification(it->first); |
| 146 | } |
| 147 | if (mod_split.size() == 2) |
| 148 | { |
| 149 | temp_aa_sequence.setModification(it->second - 1, mod_split[0]); |
| 150 | } |
| 151 | else |
| 152 | { |
| 153 | error(LOAD, String("Cannot parse modification '") + it->first + "@" + it->second + "'"); |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | // fixed modifications |
| 158 | for (const String& it : fixed_modifications_) |
| 159 | { |
| 160 | // e.g. Carboxymethyl (C) |
| 161 | vector<String> mod_split; |
| 162 | it.split(' ', mod_split); |
| 163 | if (mod_split.size() == 2) |
| 164 | { |
| 165 | if (mod_split[1] == "(C-term)") |
| 166 | { |
| 167 | temp_aa_sequence.setCTerminalModification(mod_split[0]); |
| 168 | } |
| 169 | else |
| 170 | { |
| 171 | if (mod_split[1] == "(N-term)") |
| 172 | { |
| 173 | temp_aa_sequence.setNTerminalModification(mod_split[0]); |
| 174 | } |
| 175 | else |
| 176 | { |
| 177 | String origin = mod_split[1]; |
| 178 | origin.remove(')'); |
| 179 | origin.remove('('); |
| 180 | for (Size i = 0; i != temp_aa_sequence.size(); ++i) |
| 181 | { |
nothing calls this directly
no test coverage detected