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);
114 bool unique = (identified.parent_matches.size() == 1);
115 for (
const auto& match_pair : identified.parent_matches)
117 const String& accession = match_pair.first->accession;
118 MzTabSectionRow copy = row;
119 copy.accession.set(accession);
120 copy.unique.set(unique);
121 addMzTabMoleculeParentContext_(match_pair.second, copy);
122 output.push_back(copy);
128 template <
typename MzTabSectionRow>
132 std::vector<MzTabSectionRow>& output,
133 std::map<IdentificationData::ScoreTypeRef, Size>& score_map,
134 std::map<IdentificationData::InputFileRef, Size>& file_map)
138 xsm.sequence.set(sequence);
140 xsm.search_engine_score, score_map);
142 std::vector<MzTabDouble> rts(1);
143 rts[0].set(query.
rt);
144 xsm.retention_time.set(rts);
145 xsm.charge.set(match.
charge);
146 xsm.exp_mass_to_charge.set(query.
mz);
147 xsm.calc_mass_to_charge.set(calc_mass / abs(match.
charge));
152 xsm.spectra_ref.setSpecRef(query.
data_id);
155 static const std::vector<String> meta_out({
"adduct",
"isotope_offset"});
156 for (
const String& meta : meta_out)
161 opt_meta.first =
"opt_" + meta;
163 xsm.opt_.push_back(opt_meta);
168 output.push_back(xsm);
172 static void exportStepsAndScoresToMzTab_(
175 std::map<IdentificationData::ScoreTypeRef, Size>& score_map);
178 static void addMzTabSEScores_(
179 const std::map<IdentificationData::ScoreTypeRef, Size>& scores,
180 std::map<Size, MzTabParameter>& output);
183 static void addMzTabMoleculeParentContext_(
184 const std::set<IdentificationData::MoleculeParentMatch>& matches,
188 static void addMzTabMoleculeParentContext_(
189 const std::set<IdentificationData::MoleculeParentMatch>& matches,
202 static void exportMSRunInformation_(