| 254 | } |
| 255 | |
| 256 | void MQMsms::exportFeatureMap(const FeatureMap& feature_map, const ConsensusMap& cmap, const MSExperiment& exp, const std::map<String,String>& prot_mapper) |
| 257 | { |
| 258 | if (!MQExporterHelper::isValid(filename_)) |
| 259 | { |
| 260 | OPENMS_LOG_ERROR << "MqMsms object is not valid." << std::endl; |
| 261 | throw Exception::FileNotWritable(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, filename_); |
| 262 | } |
| 263 | const std::map<Size, Size>& fTc = MQExporterHelper::makeFeatureUIDtoConsensusMapIndex_(cmap); |
| 264 | StringList spectra_data; |
| 265 | feature_map.getPrimaryMSRunPath(spectra_data); |
| 266 | String raw_file = File::basename(spectra_data.empty() ? feature_map.getLoadedFilePath() : spectra_data[0]); |
| 267 | |
| 268 | ProteinIdentification::Mapping mp_f; |
| 269 | mp_f.create(feature_map.getProteinIdentifications()); |
| 270 | |
| 271 | std::multimap<String, std::pair<Size, Size>> UIDs = PeptideIdentification::buildUIDsFromAllPepIDs(cmap); |
| 272 | |
| 273 | for (const Feature& f : feature_map) |
| 274 | { |
| 275 | const Size& f_id = f.getUniqueId(); |
| 276 | const auto& c_id = fTc.find(f_id); |
| 277 | if (c_id != fTc.end()) |
| 278 | { |
| 279 | exportRowFromFeature_(f, cmap, c_id->second, raw_file, UIDs, mp_f, exp, prot_mapper); |
| 280 | } |
| 281 | else |
| 282 | { |
| 283 | throw Exception::MissingInformation(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "Feature in FeatureMap has no associated ConsensusFeature."); |
| 284 | } |
| 285 | } |
| 286 | file_.flush(); |
| 287 | } |
| 288 | |
| 289 | |
| 290 |
no test coverage detected