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

Method exportFeatureMap

src/openms/source/QC/MQEvidenceExporter.cpp:294–325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292}
293
294void MQEvidence::exportFeatureMap(const FeatureMap& feature_map, const ConsensusMap& cmap, const MSExperiment& exp, const std::map<String,String>& prot_mapper)
295{
296if (!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}

Callers

nothing calls this directly

Calls 8

getUniqueIdMethod · 0.80
isValidFunction · 0.50
getPrimaryMSRunPathMethod · 0.45
emptyMethod · 0.45
createMethod · 0.45
findMethod · 0.45
endMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected