51 const std::vector<ProteinIdentification>& proteins,
52 const std::vector<PeptideIdentification>& peptides);
56 std::vector<ProteinIdentification>& proteins,
57 std::vector<PeptideIdentification>& peptides,
58 bool export_oligonucleotides =
false);
65 const std::vector<FASTAFile::FASTAEntry>& fasta,
68 const String& decoy_pattern =
"");
73 template <
typename MzTabSectionRow>
76 std::vector<MzTabSectionRow>& output,
77 std::map<IdentificationData::ScoreTypeRef, Size>& score_map)
82 row.best_search_engine_score, score_map);
88 opt_seq.first =
"opt_sequence";
90 row.opt_.push_back(opt_seq);
92 output.push_back(row);
96 template <
typename MzTabSectionRow,
typename IdentSeq>
98 const IdentSeq& identified, std::vector<MzTabSectionRow>& output,
99 std::map<IdentificationData::ScoreTypeRef, Size>& score_map)
103 row.sequence.set(identified.sequence.toString());
104 exportStepsAndScoresToMzTab_(identified.steps_and_scores,
106 row.best_search_engine_score, score_map);
107 if (identified.parent_matches.empty())
110 output.push_back(row);
115 row.unique.set(identified.parent_matches.size() == 1);
116 for (
const auto& match_pair : identified.parent_matches)
118 row.accession.set(match_pair.first->accession);
122 MzTabSectionRow copy = row;
123 addMzTabMoleculeParentContext_(match, copy);
124 output.push_back(copy);
131 template <
typename MzTabSectionRow>
135 std::vector<MzTabSectionRow>& output,
136 std::map<IdentificationData::ScoreTypeRef, Size>& score_map,
137 std::map<IdentificationData::InputFileRef, Size>& file_map)
141 xsm.sequence.set(sequence);
143 xsm.search_engine_score, score_map);
145 std::vector<MzTabDouble> rts(1);
146 rts[0].set(query.
rt);
147 xsm.retention_time.set(rts);
148 xsm.charge.set(match.
charge);
149 xsm.exp_mass_to_charge.set(query.
mz);
150 xsm.calc_mass_to_charge.set(calc_mass / abs(match.
charge));
155 xsm.spectra_ref.setSpecRef(query.
data_id);
158 static const std::vector<String> meta_out({
"adduct",
"isotope_offset"});
159 for (
const String& meta : meta_out)
164 opt_meta.first =
"opt_" + meta;
166 xsm.opt_.push_back(opt_meta);
171 output.push_back(xsm);
175 static void exportStepsAndScoresToMzTab_(
178 std::map<IdentificationData::ScoreTypeRef, Size>& score_map);
181 static void addMzTabSEScores_(
182 const std::map<IdentificationData::ScoreTypeRef, Size>& scores,
183 std::map<Size, MzTabParameter>& output);
186 static void addMzTabMoleculeParentContext_(
191 static void addMzTabMoleculeParentContext_(
205 static void exportMSRunInformation_(