OpenMS
Loading...
Searching...
No Matches
PeptideSearchEngineFIAlgorithm.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: $
6// $Authors: Raphael Förster $
7// --------------------------------------------------------------------------
8
9#pragma once
10
13
20
21#include <vector>
22
23namespace OpenMS
24{
25
40class OPENMS_DLLAPI PeptideSearchEngineFIAlgorithm :
42 public ProgressLogger
43{
44 public:
46
48 enum class ExitCodes
49 {
50 EXECUTION_OK,
51 INPUT_FILE_EMPTY,
52 UNEXPECTED_RESULT,
53 UNKNOWN_ERROR,
54 ILLEGAL_PARAMETERS
55 };
56
66 {
67 ExitCodes exit_code = ExitCodes::EXECUTION_OK;
68 std::vector<ProteinIdentification> protein_ids;
71 bool is_open_search = false;
72 };
73
95 ExitCodes search(const String& in_mzML,
96 const String& in_db,
97 std::vector<ProteinIdentification>& prot_ids,
98 PeptideIdentificationList& pep_ids) const;
99
145 const String& in_db,
146 const String& output_base_name = "") const;
147
161 const std::vector<FASTAFile::FASTAEntry>& fasta_db,
162 std::vector<ProteinIdentification>& prot_ids,
163 PeptideIdentificationList& pep_ids) const;
164
176 const std::vector<FASTAFile::FASTAEntry>& fasta_db,
177 const String& output_base_name = "") const;
178
179 protected:
180 void updateMembers_() override;
181
184 {
186 /*
187 StringView sequence;
188 SignedSize peptide_mod_index; ///< enumeration index of the non-RNA peptide modification
189 */
190 double score = 0;
191 std::vector<PeptideHit::PeakAnnotation> fragment_annotations;
192 double prefix_fraction = 0;
193 double suffix_fraction = 0;
194 double mean_error = 0.0;
195 int isotope_error = 0;
196 uint16_t applied_charge = 0;
197 double delta_mass = 0.0;
198
199 static bool hasBetterScore(const AnnotatedHit_& a, const AnnotatedHit_& b)
200 {
201 if (a.score != b.score) return a.score > b.score;
202 return a.sequence < b.sequence;
203 }
204 };
205
207 static void preprocessSpectra_(PeakMap& exp, double fragment_mass_tolerance, bool fragment_mass_tolerance_unit_ppm);
208
233 void postProcessHits_(const PeakMap& exp,
234 std::vector<std::vector<PeptideSearchEngineFIAlgorithm::AnnotatedHit_> >& annotated_hits,
235 std::vector<ProteinIdentification>& protein_ids,
236 PeptideIdentificationList& peptide_ids,
237 Size top_hits,
238 const StringList& modifications_fixed,
239 const StringList& modifications_variable,
240 Int peptide_missed_cleavages,
241 double precursor_mass_tolerance,
242 double fragment_mass_tolerance,
243 const String& precursor_mass_tolerance_unit_ppm,
244 const String& fragment_mass_tolerance_unit_ppm,
245 const Int precursor_min_charge,
246 const Int precursor_max_charge,
247 const String& enzyme,
248 const String& database_name) const;
249
252
255
257
259
261
263
265
267
269
271
273
277
279
281
284 const String& output_base_name) const;
285
287 bool isOpenSearchMode_() const
288 {
289 return precursor_mass_tolerance_unit_ == "ppm"
290 ? (precursor_mass_tolerance_ > 1000.0)
291 : (precursor_mass_tolerance_ > 1.0);
292 }
293};
294
295} // namespace
Representation of a peptide/protein sequence.
Definition AASequence.h:88
A base class for all classes handling default parameters.
Definition DefaultParamHandler.h:66
In-Memory representation of a mass spectrometry run.
Definition MSExperiment.h:49
Combined result of open search modification analysis.
Definition OpenSearchModificationAnalysis.h:104
Container for peptide identifications from multiple spectra.
Definition PeptideIdentificationList.h:66
Fragment-index-based peptide database search algorithm (experimental).
Definition PeptideSearchEngineFIAlgorithm.h:43
ExitCodes search(PeakMap &spectra, const std::vector< FASTAFile::FASTAEntry > &fasta_db, std::vector< ProteinIdentification > &prot_ids, PeptideIdentificationList &pep_ids) const
In-memory search: search spectra against a protein database without file I/O.
static void preprocessSpectra_(PeakMap &exp, double fragment_mass_tolerance, bool fragment_mass_tolerance_unit_ppm)
filter, deisotope, decharge spectra
SearchResult searchWithModificationAnalysis(PeakMap &spectra, const std::vector< FASTAFile::FASTAEntry > &fasta_db, const String &output_base_name="") const
In-memory search with modification analysis: no file I/O required.
Size peptide_max_size_
Definition PeptideSearchEngineFIAlgorithm.h:275
Size precursor_max_charge_
Definition PeptideSearchEngineFIAlgorithm.h:254
Size precursor_min_charge_
Definition PeptideSearchEngineFIAlgorithm.h:253
Size report_top_hits_
Definition PeptideSearchEngineFIAlgorithm.h:280
Size modifications_max_variable_mods_per_peptide_
Definition PeptideSearchEngineFIAlgorithm.h:266
String precursor_mass_tolerance_unit_
Definition PeptideSearchEngineFIAlgorithm.h:251
StringList modifications_fixed_
Definition PeptideSearchEngineFIAlgorithm.h:262
String enzyme_
Definition PeptideSearchEngineFIAlgorithm.h:268
std::vector< ProteinIdentification > protein_ids
Definition PeptideSearchEngineFIAlgorithm.h:68
Size peptide_min_size_
Definition PeptideSearchEngineFIAlgorithm.h:274
String fragment_mass_tolerance_unit_
Definition PeptideSearchEngineFIAlgorithm.h:260
IntList precursor_isotopes_
Definition PeptideSearchEngineFIAlgorithm.h:256
SearchResult searchWithModificationAnalysis(const String &in_mzML, const String &in_db, const String &output_base_name="") const
Search with comprehensive results including modification analysis tables.
bool decoys_
Definition PeptideSearchEngineFIAlgorithm.h:270
StringList annotate_psm_
Definition PeptideSearchEngineFIAlgorithm.h:272
OpenSearchModificationAnalysis::OpenSearchAnalysisResult modification_analysis
Definition PeptideSearchEngineFIAlgorithm.h:70
ExitCodes search(const String &in_mzML, const String &in_db, std::vector< ProteinIdentification > &prot_ids, PeptideIdentificationList &pep_ids) const
Search spectra in an mzML file against a protein database using an FI-backed workflow.
double precursor_mass_tolerance_
Definition PeptideSearchEngineFIAlgorithm.h:250
void postProcessHits_(const PeakMap &exp, std::vector< std::vector< PeptideSearchEngineFIAlgorithm::AnnotatedHit_ > > &annotated_hits, std::vector< ProteinIdentification > &protein_ids, PeptideIdentificationList &peptide_ids, Size top_hits, const StringList &modifications_fixed, const StringList &modifications_variable, Int peptide_missed_cleavages, double precursor_mass_tolerance, double fragment_mass_tolerance, const String &precursor_mass_tolerance_unit_ppm, const String &fragment_mass_tolerance_unit_ppm, const Int precursor_min_charge, const Int precursor_max_charge, const String &enzyme, const String &database_name) const
Filter and annotate search results.
bool isOpenSearchMode_() const
Helper function to determine if open search should be used based on tolerance.
Definition PeptideSearchEngineFIAlgorithm.h:287
PeptideIdentificationList peptide_ids
Definition PeptideSearchEngineFIAlgorithm.h:69
void updateMembers_() override
This method is used to update extra member variables at the end of the setParameters() method.
ExitCodes
Exit codes.
Definition PeptideSearchEngineFIAlgorithm.h:49
StringList modifications_variable_
Definition PeptideSearchEngineFIAlgorithm.h:264
double fragment_mass_tolerance_
Definition PeptideSearchEngineFIAlgorithm.h:258
void logModificationAnalysisSummary_(const SearchResult &result, const String &output_base_name) const
Helper: log the modification analysis summary (shared by in-memory and file-based paths)
String peptide_motif_
Definition PeptideSearchEngineFIAlgorithm.h:278
Size peptide_missed_cleavages_
Definition PeptideSearchEngineFIAlgorithm.h:276
Comprehensive search result including modification analysis.
Definition PeptideSearchEngineFIAlgorithm.h:66
Base class for all classes that want to report their progress.
Definition ProgressLogger.h:27
A more convenient string class.
Definition String.h:34
int Int
Signed integer type.
Definition Types.h:72
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition Types.h:97
std::vector< Int > IntList
Vector of signed integers.
Definition ListUtils.h:29
std::vector< String > StringList
Vector of String.
Definition ListUtils.h:44
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
Slimmer structure as storing all scored candidates in PeptideHit objects takes too much space.
Definition PeptideSearchEngineFIAlgorithm.h:184
static bool hasBetterScore(const AnnotatedHit_ &a, const AnnotatedHit_ &b)
Definition PeptideSearchEngineFIAlgorithm.h:199
double score
main score
Definition PeptideSearchEngineFIAlgorithm.h:190
AASequence sequence
Definition PeptideSearchEngineFIAlgorithm.h:185
std::vector< PeptideHit::PeakAnnotation > fragment_annotations
Definition PeptideSearchEngineFIAlgorithm.h:191