| 447 | } |
| 448 | |
| 449 | void MSstatsFile::storeISO(const String& filename, |
| 450 | const ConsensusMap& consensus_map, |
| 451 | const ExperimentalDesign& design, |
| 452 | const StringList& reannotate_filenames, |
| 453 | const String& bioreplicate, |
| 454 | const String& condition, |
| 455 | const String& mixture, |
| 456 | const String& retention_time_summarization_method) |
| 457 | { |
| 458 | // Experimental Design file |
| 459 | const ExperimentalDesign::SampleSection& sampleSection = design.getSampleSection(); |
| 460 | |
| 461 | checkConditionISO_(sampleSection, bioreplicate, condition, mixture); |
| 462 | |
| 463 | if (consensus_map.getProteinIdentifications().empty()) |
| 464 | { |
| 465 | throw Exception::IllegalArgument(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, |
| 466 | "No protein information found in the ConsensusXML."); |
| 467 | } |
| 468 | |
| 469 | // warn if we have more than one protein ID run |
| 470 | //TODO actually allow having more than one inference run e.g. for different conditions |
| 471 | if (consensus_map.getProteinIdentifications().size() > 1) |
| 472 | { |
| 473 | OPENMS_LOG_WARN << "Found " + |
| 474 | String(consensus_map.getProteinIdentifications().size()) + |
| 475 | " protein runs in consensusXML. Using first one only to parse inference data for now." << std::endl; |
| 476 | } |
| 477 | |
| 478 | if (!consensus_map.getProteinIdentifications()[0].hasInferenceData()) |
| 479 | { |
| 480 | OPENMS_LOG_WARN << "No inference was performed on the first run, defaulting to one-peptide-rule." << std::endl; |
| 481 | } |
| 482 | |
| 483 | // Maps run in MSstats input to run for OpenMS |
| 484 | map< unsigned, unsigned > msstats_run_to_openms_fractiongroup; |
| 485 | |
| 486 | // Mapping of filepath and label to sample and fraction |
| 487 | map< pair< String, unsigned >, unsigned> path_label_to_sample = design.getPathLabelToSampleMapping(true); |
| 488 | map< pair< String, unsigned >, unsigned> path_label_to_fraction = design.getPathLabelToFractionMapping(true); |
| 489 | map< pair< String, unsigned >, unsigned> path_label_to_fractiongroup = design.getPathLabelToFractionGroupMapping(true); |
| 490 | |
| 491 | // The Retention Time is additionally written to the output as soon as the user wants to resolve multiple peptides manually |
| 492 | bool rt_summarization_manual(retention_time_summarization_method == "manual"); |
| 493 | |
| 494 | if (!rt_summarization_manual) |
| 495 | { |
| 496 | OPENMS_LOG_WARN << "WARNING: rt_summarization set to something else than 'manual' but MSstatsTMT does aggregation of" |
| 497 | " intensities of peptide-chargestate combinations in the same file itself." |
| 498 | " Reverting to 'manual'" << endl; |
| 499 | rt_summarization_manual = true; |
| 500 | } |
| 501 | |
| 502 | ExperimentalDesign::MSFileSection msfile_section = design.getMSFileSection(); |
| 503 | |
| 504 | // Extract the Spectra Filepath column from the design |
| 505 | std::vector<String> design_filenames; |
| 506 | for (ExperimentalDesign::MSFileSectionEntry const& f : msfile_section) |
no test coverage detected