OpenMS
Loading...
Searching...
No Matches
SimpleSearchEngineAlgorithm.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Timo Sachsenberg $
6// $Authors: Timo Sachsenberg $
7// --------------------------------------------------------------------------
8
11
17
18#include <vector>
19
20namespace OpenMS
21{
22
23class OPENMS_DLLAPI SimpleSearchEngineAlgorithm :
25 public ProgressLogger
26{
27 public:
29
31 enum class ExitCodes
32 {
33 EXECUTION_OK,
34 INPUT_FILE_EMPTY,
35 UNEXPECTED_RESULT,
36 UNKNOWN_ERROR,
37 ILLEGAL_PARAMETERS
38 };
39
41 ExitCodes search(const String& in_spectra,
42 const String& in_db,
43 std::vector<ProteinIdentification>& prot_ids,
44 PeptideIdentificationList& pep_ids) const;
45 protected:
46 void updateMembers_() override;
47
50 {
53 // Layout: doubles first, then floats, then int, then uint16_t — minimizes padding
54 double score = 0;
55 float prefix_fraction = 0;
56 float suffix_fraction = 0;
57 float mean_error = 0.0f;
58 int isotope_error = 0;
59 uint16_t matched_b_ions = 0;
60 uint16_t matched_y_ions = 0;
61
62 static bool hasBetterScore(const AnnotatedHit_& a, const AnnotatedHit_& b)
63 {
64 if (a.score != b.score) return a.score > b.score;
66 return a.sequence < b.sequence;
67 }
68 };
69
71 static void preprocessSpectra_(PeakMap& exp, double fragment_mass_tolerance, bool fragment_mass_tolerance_unit_ppm);
72
75 void postProcessHits_(const PeakMap& exp,
76 std::vector<std::vector<SimpleSearchEngineAlgorithm::AnnotatedHit_> >& annotated_hits,
77 std::vector<ProteinIdentification>& protein_ids,
78 PeptideIdentificationList& peptide_ids,
79 Size top_hits,
80 const ModifiedPeptideGenerator::MapToResidueType& fixed_modifications,
81 const ModifiedPeptideGenerator::MapToResidueType& variable_modifications,
82 Size max_variable_mods_per_peptide,
83 const StringList& modifications_fixed,
84 const StringList& modifications_variable,
85 Int peptide_missed_cleavages,
86 double precursor_mass_tolerance,
87 double fragment_mass_tolerance,
88 const String& precursor_mass_tolerance_unit_ppm,
89 const String& fragment_mass_tolerance_unit_ppm,
90 const Int precursor_min_charge,
91 const Int precursor_max_charge,
92 const String& enzyme,
93 const String& database_name) const;
94
97
100
102
104
106
108
110
112
114
116
117 double fdr_psm_;
118
120
124 EnzymaticDigestion::Specificity peptide_enzyme_specificity_{EnzymaticDigestion::SPEC_FULL};
125
127
129};
130
131} // namespace
132
A base class for all classes handling default parameters.
Definition DefaultParamHandler.h:66
Specificity
when querying for valid digestion products, this determines if the specificity of the two peptide end...
Definition EnzymaticDigestion.h:42
In-Memory representation of a mass spectrometry run.
Definition MSExperiment.h:49
Definition ModifiedPeptideGenerator.h:31
Container for peptide identifications from multiple spectra.
Definition PeptideIdentificationList.h:66
Base class for all classes that want to report their progress.
Definition ProgressLogger.h:27
Definition SimpleSearchEngineAlgorithm.h:26
static void preprocessSpectra_(PeakMap &exp, double fragment_mass_tolerance, bool fragment_mass_tolerance_unit_ppm)
filter, deisotope, decharge spectra
Size peptide_max_size_
Definition SimpleSearchEngineAlgorithm.h:122
void postProcessHits_(const PeakMap &exp, std::vector< std::vector< SimpleSearchEngineAlgorithm::AnnotatedHit_ > > &annotated_hits, std::vector< ProteinIdentification > &protein_ids, PeptideIdentificationList &peptide_ids, Size top_hits, const ModifiedPeptideGenerator::MapToResidueType &fixed_modifications, const ModifiedPeptideGenerator::MapToResidueType &variable_modifications, Size max_variable_mods_per_peptide, 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 most of the parameters are used to properly add meta data to the i...
Size precursor_max_charge_
Definition SimpleSearchEngineAlgorithm.h:99
Size precursor_min_charge_
Definition SimpleSearchEngineAlgorithm.h:98
Size report_top_hits_
Definition SimpleSearchEngineAlgorithm.h:128
Size modifications_max_variable_mods_per_peptide_
Definition SimpleSearchEngineAlgorithm.h:111
String precursor_mass_tolerance_unit_
Definition SimpleSearchEngineAlgorithm.h:96
StringList modifications_fixed_
Definition SimpleSearchEngineAlgorithm.h:107
String enzyme_
Definition SimpleSearchEngineAlgorithm.h:113
Size peptide_min_size_
Definition SimpleSearchEngineAlgorithm.h:121
String fragment_mass_tolerance_unit_
Definition SimpleSearchEngineAlgorithm.h:105
IntList precursor_isotopes_
Definition SimpleSearchEngineAlgorithm.h:101
bool decoys_
Definition SimpleSearchEngineAlgorithm.h:115
StringList annotate_psm_
Definition SimpleSearchEngineAlgorithm.h:119
double fdr_psm_
Definition SimpleSearchEngineAlgorithm.h:117
double precursor_mass_tolerance_
Definition SimpleSearchEngineAlgorithm.h:95
void updateMembers_() override
This method is used to update extra member variables at the end of the setParameters() method.
ExitCodes search(const String &in_spectra, const String &in_db, std::vector< ProteinIdentification > &prot_ids, PeptideIdentificationList &pep_ids) const
search spectra against database
ExitCodes
Exit codes.
Definition SimpleSearchEngineAlgorithm.h:32
StringList modifications_variable_
Definition SimpleSearchEngineAlgorithm.h:109
double fragment_mass_tolerance_
Definition SimpleSearchEngineAlgorithm.h:103
String peptide_motif_
Definition SimpleSearchEngineAlgorithm.h:126
Size peptide_missed_cleavages_
Definition SimpleSearchEngineAlgorithm.h:123
StringView provides a non-owning view on an existing string.
Definition StringView.h:28
A more convenient string class.
Definition String.h:32
int Int
Signed integer type.
Definition Types.h:72
ptrdiff_t SignedSize
Signed Size type e.g. used as pointer difference.
Definition Types.h:104
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 SimpleSearchEngineAlgorithm.h:50
static bool hasBetterScore(const AnnotatedHit_ &a, const AnnotatedHit_ &b)
Definition SimpleSearchEngineAlgorithm.h:62
double score
main score
Definition SimpleSearchEngineAlgorithm.h:54
StringView sequence
Definition SimpleSearchEngineAlgorithm.h:51
SignedSize peptide_mod_index
enumeration index of the non-RNA peptide modification
Definition SimpleSearchEngineAlgorithm.h:52