| 292 | } |
| 293 | |
| 294 | void MQEvidence::exportFeatureMap(const FeatureMap& feature_map, const ConsensusMap& cmap, const MSExperiment& exp, const std::map<String,String>& prot_mapper) |
| 295 | { |
| 296 | if (!MQExporterHelper::isValid(filename_)) |
| 297 | { |
| 298 | OPENMS_LOG_ERROR << "MqEvidence object is not valid." << std::endl; |
| 299 | throw Exception::FileNotWritable(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, filename_); |
| 300 | } |
| 301 | const std::map<Size, Size>& fTc = MQExporterHelper::makeFeatureUIDtoConsensusMapIndex_(cmap); |
| 302 | StringList spectra_data; |
| 303 | feature_map.getPrimaryMSRunPath(spectra_data); |
| 304 | String raw_file = File::basename(spectra_data.empty() ? feature_map.getLoadedFilePath() : spectra_data[0]); |
| 305 | |
| 306 | ProteinIdentification::Mapping mp_f; |
| 307 | mp_f.create(feature_map.getProteinIdentifications()); |
| 308 | |
| 309 | std::multimap<String, std::pair<Size, Size>> UIDs = PeptideIdentification::buildUIDsFromAllPepIDs(cmap); |
| 310 | |
| 311 | for (const Feature& f : feature_map) |
| 312 | { |
| 313 | const Size& f_id = f.getUniqueId(); |
| 314 | const auto& c_id = fTc.find(f_id); |
| 315 | if (c_id != fTc.end()) |
| 316 | { |
| 317 | exportRowFromFeature_(f, cmap, c_id->second, raw_file, UIDs, mp_f, exp, prot_mapper); |
| 318 | } |
| 319 | else |
| 320 | { |
| 321 | throw Exception::MissingInformation(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "Feature in FeatureMap has no associated ConsensusFeature."); |
| 322 | } |
| 323 | } |
| 324 | file_.flush(); |
| 325 | } |
nothing calls this directly
no test coverage detected