53 const std::vector<ProteinIdentification>& proteins,
54 const std::vector<PeptideIdentification>& peptides);
62 std::vector<ProteinIdentification>& proteins,
63 std::vector<PeptideIdentification>& peptides,
64 bool export_ids_wo_scores =
false);
71 const std::vector<FASTAFile::FASTAEntry>& fasta,
74 const String& decoy_pattern =
"");
77 static void exportParentMatches(
86 static void importFeatureIDs(
FeatureMap& features,
bool clear_original =
true);
94 static void exportFeatureIDs(
FeatureMap& features,
bool clear_original =
true);
102 static void importConsensusIDs(
ConsensusMap& consensus,
bool clear_original =
true);
110 static void exportConsensusIDs(
ConsensusMap& consensus,
bool clear_original =
true);
114 using StepOpt = std::optional<IdentificationData::ProcessingStepRef>;
122 if (!left)
return bool(right);
123 if (!right)
return false;
124 return **left < **right;
149 else if (right.
hasRT())
166 return right.
hasMZ();
171 template <
typename MzTabSectionRow>
174 std::vector<MzTabSectionRow>& output,
175 std::map<IdentificationData::ScoreTypeRef, Size>& score_map)
180 row.best_search_engine_score, score_map);
186 opt_seq.first =
"opt_sequence";
187 opt_seq.second.set(parent.
sequence);
188 row.opt_.push_back(opt_seq);
190 output.push_back(row);
194 template <
typename MzTabSectionRow,
typename IdentSeq>
196 const IdentSeq& identified, std::vector<MzTabSectionRow>& output,
197 std::map<IdentificationData::ScoreTypeRef, Size>& score_map)
201 row.sequence.set(identified.sequence.toString());
202 exportStepsAndScoresToMzTab_(identified.steps_and_scores,
204 row.best_search_engine_score, score_map);
205 if (identified.parent_matches.empty())
208 output.push_back(row);
213 row.unique.set(identified.parent_matches.size() == 1);
214 for (
const auto& match_pair : identified.parent_matches)
216 row.accession.set(match_pair.first->accession);
220 MzTabSectionRow copy = row;
221 addMzTabMoleculeParentContext_(match, copy);
222 output.push_back(copy);
229 template <
typename MzTabSectionRow>
233 std::vector<MzTabSectionRow>& output,
234 std::map<IdentificationData::ScoreTypeRef, Size>& score_map,
235 std::map<IdentificationData::InputFileRef, Size>& file_map)
239 xsm.sequence.set(sequence);
241 xsm.search_engine_score, score_map);
243 std::vector<MzTabDouble> rts(1);
244 rts[0].set(query.
rt);
245 xsm.retention_time.set(rts);
246 xsm.charge.set(match.
charge);
247 xsm.exp_mass_to_charge.set(query.
mz);
248 xsm.calc_mass_to_charge.set(calc_mass / abs(match.
charge));
249 xsm.spectra_ref.setMSFile(file_map[query.
input_file]);
250 xsm.spectra_ref.setSpecRef(query.
data_id);
255 opt_adduct.first =
"opt_adduct";
256 opt_adduct.second.set((*match.
adduct_opt)->getName());
257 xsm.opt_.push_back(opt_adduct);
265 opt_meta.first =
"opt_isotope_offset";
266 opt_meta.second.set(match.
getMetaValue(
"isotope_offset"));
267 xsm.opt_.push_back(opt_meta);
271 output.push_back(xsm);
275 static void exportStepsAndScoresToMzTab_(
278 std::map<IdentificationData::ScoreTypeRef, Size>& score_map);
281 static void addMzTabSEScores_(
282 const std::map<IdentificationData::ScoreTypeRef, Size>& scores,
283 std::map<Size, MzTabParameter>& output);
286 static void addMzTabMoleculeParentContext_(
291 static void addMzTabMoleculeParentContext_(
305 static void exportMSRunInformation_(
309 static void handleFeatureImport_(
Feature& feature,
const IntList& indexes,
310 std::vector<PeptideIdentification>& peptides,
311 Size& id_counter,
bool clear_original);
313 static void handleFeatureExport_(
Feature& feature,
const IntList& indexes,
Representation of a protein identification run.
Definition: ProteinIdentification.h:74
double coverage
sequence coverage as a fraction between 0 and 1
Definition: ParentSequence.h:61
bool operator()(const StepOpt &left, const StepOpt &right) const
Definition: IdentificationDataConverter.h:119
A more convenient string class.
Definition: String.h:58
OLI - Oligonucleotide section (table-based)
Definition: MzTab.h:396
MoleculeType
Definition: MetaData.h:65
bool hasMZ() const
shortcut for isnan(getRT())
AppliedProcessingSteps steps_and_scores
Definition: ScoredProcessingResult.h:46
A container for features.
Definition: FeatureMap.h:98
Representation of a parent sequence that is identified only indirectly (e.g. a protein).
Definition: ParentSequence.h:49
Meta data for the association between an identified molecule (e.g. peptide) and a parent sequence (e...
Definition: ParentMatch.h:45
String data_id
Spectrum or feature ID (from the file referenced by input_file)
Definition: Observation.h:56
IdentificationDataInternal::ParentMatches ParentMatches
Definition: IdentificationData.h:164
Definition: IdentificationData.h:112
A container for consensus elements.
Definition: ConsensusMap.h:84
std::vector< Int > IntList
Vector of signed integers.
Definition: ListUtils.h:55
String sequence
Definition: ParentSequence.h:57
Definition: MzTabBase.h:268
Representation of an observation, e.g. a spectrum or feature, in an input data file.
Definition: Observation.h:53
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
Definition: IdentificationDataConverter.h:47
Search parameters of the DB search.
Definition: ProteinIdentification.h:271
double getMZ() const
returns the MZ of the MS2 spectrum
static void exportObservationMatchToMzTab_(const String &sequence, const IdentificationData::ObservationMatch &match, double calc_mass, std::vector< MzTabSectionRow > &output, std::map< IdentificationData::ScoreTypeRef, Size > &score_map, std::map< IdentificationData::InputFileRef, Size > &file_map)
Export an input match (peptide- or oligonucleotide-spectrum match) to mzTab.
Definition: IdentificationDataConverter.h:230
InputFileRef input_file
Reference to the input file.
Definition: Observation.h:59
IdentificationDataInternal::AppliedProcessingSteps AppliedProcessingSteps
Definition: IdentificationData.h:153
double getRT() const
returns the RT of the MS2 spectrum where the identification occurred
Representation of a peptide hit.
Definition: PeptideHit.h:55
bool hasRT() const
shortcut for isnan(getRT())
An LC-MS feature.
Definition: Feature.h:70
String accession
Definition: ParentSequence.h:51
Definition: MetaData.h:67
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:195
double mz
Definition: Observation.h:61
AdductOpt adduct_opt
optional reference to adduct
Definition: ObservationMatch.h:81
Representation of a search hit (e.g. peptide-spectrum match).
Definition: ObservationMatch.h:73
Functor for ordering peptide IDs by RT and m/z (if available)
Definition: IdentificationDataConverter.h:129
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
bool operator()(const PeptideIdentification &left, const PeptideIdentification &right) const
Definition: IdentificationDataConverter.h:131
Int charge
Definition: ObservationMatch.h:79
static void exportParentSequenceToMzTab_(const IdentificationData::ParentSequence &parent, std::vector< MzTabSectionRow > &output, std::map< IdentificationData::ScoreTypeRef, Size > &score_map)
Export a parent sequence (protein or nucleic acid) to mzTab.
Definition: IdentificationDataConverter.h:172
Functor for ordering StepOpt (by date of the steps, if available):
Definition: IdentificationDataConverter.h:117
String description
Definition: ParentSequence.h:59
double rt
Definition: Observation.h:61
PEP - Peptide section (Table based)
Definition: MzTab.h:242
ObservationRef observation_ref
Definition: ObservationMatch.h:77
std::optional< IdentificationData::ProcessingStepRef > StepOpt
Definition: IdentificationDataConverter.h:114
Wrapper that adds operator< to iterators, so they can be used as (part of) keys in maps/sets or multi...
Definition: MetaData.h:45
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:63
std::pair< String, MzTabString > MzTabOptionalColumnEntry
Definition: MzTabBase.h:229
Data model of MzTab files. Please see the official MzTab specification at https://code.google.com/p/mztab/.
Definition: MzTab.h:477