| 1990 | } |
| 1991 | |
| 1992 | MzTab::IDMzTabStream::IDMzTabStream( |
| 1993 | const std::vector<const ProteinIdentification*>& prot_ids, |
| 1994 | const std::vector<const PeptideIdentification*>& peptide_ids, |
| 1995 | const String& filename, |
| 1996 | bool first_run_inference_only, |
| 1997 | bool export_empty_pep_ids, |
| 1998 | bool export_all_psms, |
| 1999 | const String& title): |
| 2000 | prot_ids_(prot_ids), |
| 2001 | peptide_ids_(peptide_ids), |
| 2002 | filename_(filename), |
| 2003 | export_empty_pep_ids_(export_empty_pep_ids), |
| 2004 | export_all_psms_(export_all_psms) |
| 2005 | { |
| 2006 | //////////////////////////////////////////////// |
| 2007 | // create some lookup structures and precalculate some values |
| 2008 | idrunid_2_idrunindex_ = MzTab::mapIDRunIdentifier2IDRunIndex_(prot_ids_); |
| 2009 | |
| 2010 | bool has_inference_data = prot_ids_.empty() ? false : prot_ids_[0]->hasInferenceData(); |
| 2011 | |
| 2012 | first_run_inference_ = has_inference_data && first_run_inference_only; |
| 2013 | if (first_run_inference_) |
| 2014 | { |
| 2015 | OPENMS_LOG_INFO << "MzTab: Inference data provided. Considering first run only for inference data." << std::endl; |
| 2016 | } |
| 2017 | |
| 2018 | map<String, size_t> msfilename_2_msrunindex; |
| 2019 | map<size_t, String> msrunindex_2_msfilename; |
| 2020 | MzTab::mapBetweenMSFileNameAndMSRunIndex_(prot_ids_, first_run_inference_, msfilename_2_msrunindex, msrunindex_2_msfilename); |
| 2021 | |
| 2022 | // MS runs of a peptide identification object is stored in |
| 2023 | // the protein identification object with the same "identifier". |
| 2024 | // Thus, we build a map from psm_idx->run_index (aka index of PeptideHit -> run index) |
| 2025 | MzTab::mapIDRunFileIndex2MSFileIndex_(prot_ids_, msfilename_2_msrunindex, first_run_inference_, map_id_run_fileidx_2_msfileidx_); |
| 2026 | |
| 2027 | // collect variable and fixed modifications from different runs |
| 2028 | StringList var_mods; |
| 2029 | MzTab::getSearchModifications_(prot_ids_, var_mods, fixed_mods_); |
| 2030 | |
| 2031 | // Determine search engines used in the different MS runs. |
| 2032 | map<tuple<String, String, String>, set<Size>> search_engine_to_runs; |
| 2033 | map<String, vector<pair<String,String>>> search_engine_to_settings; |
| 2034 | |
| 2035 | // search engine and version <-> MS runs index |
| 2036 | MzTab::mapBetweenRunAndSearchEngines_( |
| 2037 | prot_ids_, |
| 2038 | peptide_ids_, |
| 2039 | first_run_inference_, |
| 2040 | search_engine_to_runs, |
| 2041 | run_to_search_engines_, |
| 2042 | run_to_search_engines_settings_, |
| 2043 | search_engine_to_settings); |
| 2044 | |
| 2045 | /////////////////////////////////////// |
| 2046 | // create column names from meta values |
| 2047 | MzTab::getIdentificationMetaValues_( |
| 2048 | prot_ids, |
| 2049 | peptide_ids_, |
nothing calls this directly
no test coverage detected