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

Method addSearchMetaData_

src/openms/source/FORMAT/MzTab.cpp:1786–1972  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1784 }
1785
1786 void MzTab::addSearchMetaData_(
1787 const vector<const ProteinIdentification*>& prot_ids,
1788 const map<tuple<String, String, String>, set<Size>>& search_engine_to_runs,
1789 const map<String, vector<pair<String,String>>>& search_engine_to_settings,
1790 MzTabMetaData& meta_data,
1791 bool first_run_inference_only)
1792 {
1793 set<String> protein_scoretypes;
1794 map<pair<String, String>, vector<pair<String,String>>> protein_settings;
1795 for (const auto& prot_run : prot_ids)
1796 {
1797 //TODO this is a little hack to convert back and from
1798 protein_scoretypes.insert(getProteinScoreType_(*prot_run).toCellString());
1799 if (prot_run->hasInferenceData())
1800 {
1801 String eng = prot_run->getInferenceEngine();
1802 String ver = prot_run->getInferenceEngineVersion();
1803 protein_settings.emplace(make_pair(std::move(eng), std::move(ver)),vector<pair<String,String>>{});
1804 // TODO add settings for inference tools?
1805 }
1806 if (first_run_inference_only) break;
1807 }
1808
1809 Size cnt(1);
1810 for (const auto& mztpar : protein_scoretypes)
1811 {
1812 MzTabParameter p{};
1813 //TODO actually we should make a distinction between protein and protein group-level FDRs
1814 if (mztpar.hasSubstring("q-value"))
1815 {
1816 p.fromCellString("[MS,MS:1003117,OpenMS:Target-decoy protein q-value, ]");
1817 }
1818 else if (mztpar.hasSubstring("Epifany"))
1819 {
1820 p.fromCellString("[MS,MS:1003119,EPIFANY:Protein posterior probability,]");
1821 }
1822 else
1823 {
1824 p.fromCellString(mztpar);
1825 }
1826
1827 meta_data.protein_search_engine_score[cnt] = p;
1828 cnt++;
1829 }
1830
1831 for (const auto& eng_ver_settings : protein_settings)
1832 {
1833 MzTabSoftwareMetaData sesoftwaremd;
1834 MzTabParameter sesoftware;
1835 if (eng_ver_settings.first.first == "Epifany")
1836 {
1837 sesoftware.fromCellString("[MS,MS:1003118,EPIFANY," + eng_ver_settings.first.second + "]");
1838 }
1839 else if (eng_ver_settings.first.first == "TOPPProteinInference")
1840 {
1841 sesoftware.fromCellString("[MS,MS:1002203,TOPP ProteinInference," + eng_ver_settings.first.second + "]");
1842 }
1843 else

Callers

nothing calls this directly

Calls 11

hasInferenceDataMethod · 0.80
getInferenceEngineMethod · 0.80
hasSubstringMethod · 0.80
atMethod · 0.80
insertMethod · 0.45
toCellStringMethod · 0.45
fromCellStringMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45
suffixMethod · 0.45

Tested by

no test coverage detected