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

Function remapTargetDecoyProteinSection_

src/openms/source/FORMAT/MzTab.cpp:323–343  ·  view source on GitHub ↗

static method remapping the target/decoy column from an opt_ to a standardized column

Source from the content-addressed store, hash-verified

321
322 // static method remapping the target/decoy column from an opt_ to a standardized column
323 static void remapTargetDecoyProteinSection_(std::vector<MzTabOptionalColumnEntry>& opt_entries)
324 {
325 const String old_header("opt_global_target_decoy");
326 const String new_header("opt_global_cv_PRIDE:0000303_decoy_hit"); // for PRIDE
327 for (auto &opt_entry : opt_entries)
328 {
329 if (opt_entry.first == old_header || opt_entry.first == new_header)
330 {
331 opt_entry.first = new_header;
332 const String &current_value = opt_entry.second.get();
333 if (current_value == "target" || current_value == "target+decoy")
334 {
335 opt_entry.second = MzTabString("0");
336 }
337 else if (current_value == "decoy")
338 {
339 opt_entry.second = MzTabString("1");
340 }
341 }
342 }
343 }
344
345 const MzTabMetaData& MzTab::getMetaData() const
346 {

Calls 1

getMethod · 0.45

Tested by

no test coverage detected