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_(
boost::optional< InputFileRef > input_file_opt
Definition: DataQuery.h:53
A more convenient string class.
Definition: String.h:58
const DataValue & getMetaValue(const String &name, const DataValue &default_value=DataValue::EMPTY) const
Returns the value corresponding to a string, or a default value (default: DataValue::EMPTY) if not fo...
IdentificationDataInternal::AppliedProcessingSteps AppliedProcessingSteps
Definition: IdentificationData.h:123
Representation of a parent molecule that is identified only indirectly (e.g. a protein).
Definition: ParentMolecule.h:49
String data_id
spectrum or feature ID (from the file referenced by "input_file_ref"):
Definition: DataQuery.h:50
static void exportQueryMatchToMzTab_(const String &sequence, const IdentificationData::MoleculeQueryMatch &match, double calc_mass, std::vector< MzTabSectionRow > &output, std::map< IdentificationData::ScoreTypeRef, Size > &score_map, std::map< IdentificationData::InputFileRef, Size > &file_map)
Export a molecule-query match (peptide- or oligonucleotide-spectrum match) to mzTab.
Definition: IdentificationDataConverter.h:129
DataQueryRef data_query_ref
Definition: MoleculeQueryMatch.h:65
Definition: MetaData.h:65
Wrapper that adds operator< to iterators, so they can be used as (part of) keys in maps/sets or multi...
Definition: MetaData.h:43
String description
Definition: ParentMolecule.h:59
OLI - Oligonucleotide section (table-based)
Definition: MzTab.h:774
PEP - Peptide section (Table based)
Definition: MzTab.h:628
Definition: IdentificationDataConverter.h:45
double coverage
sequence coverage as a fraction between 0 and 1
Definition: ParentMolecule.h:61
Search query, e.g. spectrum or feature.
Definition: DataQuery.h:47
Representation of a protein identification run.
Definition: ProteinIdentification.h:71
Meta data for a search hit (e.g. peptide-spectrum match).
Definition: MoleculeQueryMatch.h:61
static void exportPeptideOrOligoToMzTab_(const IdentSeq &identified, std::vector< MzTabSectionRow > &output, std::map< IdentificationData::ScoreTypeRef, Size > &score_map)
Export an identified sequence (peptide or oligonucleotide, but not small molecule/compound) to mzTab...
Definition: IdentificationDataConverter.h:97
Int charge
Definition: MoleculeQueryMatch.h:67
double rt
Definition: DataQuery.h:55
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
AppliedProcessingSteps steps_and_scores
Definition: ScoredProcessingResult.h:46
Data model of MzTab files. Please see the official MzTab specification at https://code.google.com/p/mztab/.
Definition: MzTab.h:855
String sequence
Definition: ParentMolecule.h:57
static void exportParentMoleculeToMzTab_(const IdentificationData::ParentMolecule &parent, std::vector< MzTabSectionRow > &output, std::map< IdentificationData::ScoreTypeRef, Size > &score_map)
Export a parent molecule (protein or nucleic acid) to mzTab.
Definition: IdentificationDataConverter.h:74
String accession
Definition: ParentMolecule.h:51
double mz
Definition: DataQuery.h:55
std::pair< String, MzTabString > MzTabOptionalColumnEntry
Definition: MzTab.h:586
Representation of spectrum identification results and associated data.
Definition: IdentificationData.h:89
Search parameters of the DB search.
Definition: ProteinIdentification.h:221
bool metaValueExists(const String &name) const
Returns whether an entry with the given name exists.
MoleculeType
Definition: MetaData.h:63