OpenMS
Loading...
Searching...
No Matches
ProSEAlgorithm.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
21
22#include <algorithm> // std::min (used by inline computeModMatchTolerance_)
23#include <iosfwd> // std::ostream (renderRunSummary / renderModificationSummary)
24#include <map>
25#include <string> // std::string (renderRunSummaryJson return / manifest)
26#include <unordered_set>
27#include <utility> // std::pair (renderRunSummaryJson manifest)
28#include <vector>
29
30namespace OpenMS
31{
32
33class TheoreticalSpectrumGenerator;
34
49class OPENMS_DLLAPI ProSEAlgorithm :
51 public ProgressLogger
52{
53 public:
55
57 enum class ExitCodes
58 {
59 EXECUTION_OK,
60 INPUT_FILE_EMPTY,
61 UNEXPECTED_RESULT,
62 UNKNOWN_ERROR,
63 ILLEGAL_PARAMETERS
64 };
65
76 {
77 std::string input_file;
78 Size ms2_spectra = 0;
79 Size matched_spectra = 0;
80 Size target_psms = 0;
81 Size decoy_psms = 0;
82 bool fdr_applied = false;
83 double achieved_psm_fdr = -1.0;
84 Size unique_peptides = 0;
85 Size unique_proteins = 0;
86 std::map<Int, Size> charge_histogram;
87 std::map<Size, Size> missed_cleavage_histogram;
88 bool score_stats_valid = false;
89 double hyperscore_min = 0.0;
90 double hyperscore_median = 0.0;
91 double hyperscore_max = 0.0;
92 bool prec_tol_valid = false;
93 double prec_err_median = 0.0, prec_err_mad = 0.0, prec_err_recommended = 0.0;
94 bool frag_tol_valid = false;
95 double frag_err_median = 0.0, frag_err_mad = 0.0, frag_err_recommended = 0.0;
96 double seconds_search = 0.0;
97 double seconds_calibration = 0.0;
98 double seconds_fdr = 0.0;
99 };
100
110 {
111 std::string database_file;
112 std::string enzyme;
113 double precursor_tol_lower = 0.0, precursor_tol_upper = 0.0;
115 double fragment_tol = 0.0;
116 std::string fragment_tol_unit;
117 Int min_charge = 0, max_charge = 0;
118 Size missed_cleavages = 0;
119 std::vector<std::string> fixed_mods, variable_mods, ion_series;
120 bool open_search = false;
121 bool calibration_enabled = false;
122 bool snes_mode = false;
123 bool chunked = false;
124 std::string decoy_mode;
125 double psm_fdr_threshold = 0.0, protein_fdr_threshold = 0.0;
126 Size db_target_proteins = 0;
127 Size db_decoy_proteins = 0;
128 Size indexed_peptides = 0;
129 Size indexed_fragments = 0;
130 double seconds_index_build = 0.0;
131 double seconds_total = 0.0;
132 };
133
144 {
145 ExitCodes exit_code = ExitCodes::EXECUTION_OK;
146 std::vector<ProteinIdentification> protein_ids;
149 bool is_open_search = false;
151 };
152
186 {
187 std::vector<SearchResult> per_file;
189
193 std::string decoy_string;
195 bool decoy_is_prefix = true;
197 bool have_decoys = false;
198
202 };
203
213 {
214 std::vector<FASTAFile::FASTAEntry> db;
216
226 bool release_fragment_index_after_scoring = false;
227
232 std::string decoy_string;
234 bool decoy_is_prefix = true;
237 bool have_decoys = false;
242 bool electron_ions = false;
243 };
244
266 ExitCodes search(const std::string& in_spectra,
267 const std::string& in_db,
268 std::vector<ProteinIdentification>& prot_ids,
269 PeptideIdentificationList& pep_ids) const;
270
295 static void applyCompleteSetProteinFDR(std::vector<ProteinIdentification>& protein_ids,
296 PeptideIdentificationList& peptide_ids,
297 const std::string& decoy_string,
298 bool decoy_is_prefix,
299 double protein_fdr);
300
346 SearchResult searchWithModificationAnalysis(const std::string& in_spectra,
347 const std::string& in_db,
348 const std::string& output_base_name = "") const;
349
368 const std::vector<FASTAFile::FASTAEntry>& fasta_db,
369 std::vector<ProteinIdentification>& prot_ids,
370 PeptideIdentificationList& pep_ids) const;
371
392 SearchContext prepareContext(const std::vector<FASTAFile::FASTAEntry>& fasta_db) const;
393
407 SearchContext prepareContext(const std::vector<FASTAFile::FASTAEntry>& fasta_db, bool electron_ions) const;
408
430 SearchContext& ctx,
431 std::vector<ProteinIdentification>& prot_ids,
432 PeptideIdentificationList& pep_ids) const;
433
445 const std::vector<FASTAFile::FASTAEntry>& fasta_db,
446 const std::string& output_base_name = "") const;
447
485 const std::vector<std::string>& in_spectra_files,
486 const std::vector<FASTAFile::FASTAEntry>& fasta_db,
487 const std::vector<std::string>& output_base_names = {},
488 const std::string& aggregate_base_name = "",
489 bool build_pooled_aggregate = true) const;
490
505 const std::vector<std::string>& in_spectra_files,
506 const std::string& in_db,
507 const std::vector<std::string>& output_base_names = {},
508 const std::string& aggregate_base_name = "",
509 bool build_pooled_aggregate = true) const;
510
511 protected:
512 void updateMembers_() override;
513
516 {
518 /*
519 std::string_view sequence;
520 SignedSize peptide_mod_index; ///< enumeration index of the non-RNA peptide modification
521 */
522 // Layout: doubles first, then floats, then int, then uint16_t — minimizes padding (40 bytes excluding AASequence)
523 double score = 0;
524 double delta_mass = 0.0;
525 float prefix_fraction = 0;
526 float suffix_fraction = 0;
527 float mean_error = 0.0f;
528 int isotope_error = 0;
529 uint16_t applied_charge = 0;
530 uint16_t matched_prefix_ions = 0;
531 uint16_t matched_suffix_ions = 0;
532
533 static bool hasBetterScore(const AnnotatedHit_& a, const AnnotatedHit_& b)
534 {
535 if (a.score != b.score) return a.score > b.score;
536 return a.sequence < b.sequence;
537 }
538 };
539
560 {
561 double sum = 0.0;
562 double sumsq = 0.0;
563 double best = 0.0;
564 double second_best = 0.0;
565 Size count = 0;
568 std::unordered_set<std::string> seen_candidates;
569
571 void add(double score)
572 {
573 if (score > best) { second_best = best; best = score; }
574 else if (score > second_best) { second_best = score; }
575 sum += score;
576 sumsq += score * score;
577 ++count;
578 }
579
581 double deltaScore() const { return best - second_best; }
582
604 double zScore() const;
605 };
606
615 static void preprocessSpectra_(PeakMap& exp,
616 double fragment_mass_tolerance,
617 bool fragment_mass_tolerance_unit_ppm,
618 bool deisotope_requested,
619 Size peaks_keep_n,
620 Int peaks_window_top,
621 const std::string& window_type = "auto",
622 PeakMap* evidence_spectra = nullptr,
623 PeakMap* query_spectra = nullptr);
624
626 static void filterLocalPeaks_(MSSpectrum& spectrum, Size peaks_per_window);
627
629 enum class DecoyMode_
630 {
631 AUTO,
632 GENERATE,
633 IGNORE
634 };
635
644 {
645 bool generate{false};
646 bool strip_existing{false};
647 bool have_decoys{false};
648 std::string decoy_string;
649 bool is_prefix{true};
650 std::string strip_string;
651 bool strip_is_prefix{true};
652 };
653
663 const std::vector<FASTAFile::FASTAEntry>& db) const;
664
677 Param fragmentIndexParameters_(bool electron_ions = false) const;
678
681 struct SpectrumGenerators_;
682
684 SpectrumGenerators_ spectrumGenerators_() const;
685
688 {
689 double chance_match_surprise = 0.0;
690 double mass_competition_evidence = 0.0;
691 };
692
694 static std::vector<double> localPeakDensities_(const MSSpectrum& spectrum);
695
715 const MSSpectrum& theoretical,
716 const std::vector<double>& densities,
717 double tolerance, bool ppm);
718
720 static bool isElectronActivated_(const MSSpectrum& spectrum);
721
723 Size countElectronActivated_(const PeakMap& spectra) const;
724
732 std::vector<FASTAFile::FASTAEntry> buildDecoyAugmentedDB_(
733 const std::vector<FASTAFile::FASTAEntry>& fasta_db,
734 const DecoyStrategy_& strategy) const;
735
749 std::vector<FASTAFile::FASTAEntry> buildCalibrationSample_(
750 const std::vector<FASTAFile::FASTAEntry>& full_db) const;
751
766 PeakMap& spectra,
767 std::vector<FASTAFile::FASTAEntry>& full_db,
768 const DecoyStrategy_& strategy,
769 std::vector<ProteinIdentification>& protein_ids,
770 PeptideIdentificationList& peptide_ids) const;
771
797 const PeakMap& spectra,
798 FragmentIndex& fi,
799 const std::vector<FASTAFile::FASTAEntry>& db,
800 const SpectrumGenerators_& generators,
801 double effective_fragment_tol,
802 bool fragment_mass_tolerance_unit_ppm,
803 bool open_search_mode,
804 std::vector<std::vector<AnnotatedHit_>>& annotated_hits,
805 std::vector<CandidatePoolStats_>& pool_stats,
806 const std::string& progress_label,
807 const PeakMap* query_spectra = nullptr) const;
808
838 void postProcessHits_(const PeakMap& exp,
839 std::vector<std::vector<ProSEAlgorithm::AnnotatedHit_> >& annotated_hits,
840 const std::vector<CandidatePoolStats_>& pool_stats,
841 std::vector<ProteinIdentification>& protein_ids,
842 PeptideIdentificationList& peptide_ids,
843 Size top_hits,
844 const StringList& modifications_fixed,
845 const StringList& modifications_variable,
846 Int peptide_missed_cleavages,
847 double precursor_mass_tolerance,
848 double fragment_mass_tolerance,
849 const std::string& precursor_mass_tolerance_unit_ppm,
850 const std::string& fragment_mass_tolerance_unit_ppm,
851 const Int precursor_min_charge,
852 const Int precursor_max_charge,
853 const std::string& enzyme,
854 const std::string& database_name,
855 const PeakMap* evidence_spectra = nullptr) const;
856
860 mutable double precursor_mass_tolerance_lower_{10.0};
861 mutable double precursor_mass_tolerance_upper_{10.0};
862 std::string precursor_mass_tolerance_unit_{"ppm"};
863
866
868
870
872
877 bool deisotope_requested_{true};
878 bool scoring_multiple_charges_{false};
879 int scoring_max_charge_{2};
880
882 int scoringMaxCharge_(int precursor_charge) const
883 {
884 return scoring_multiple_charges_ ? std::max(1, std::min(precursor_charge - 1, scoring_max_charge_)) : 1;
885 }
886 Size peaks_keep_n_{0};
887 Int peaks_window_top_{20};
888 std::string peaks_window_type_ {"auto"};
889 bool query_raw_spectrum_{false};
890
892
894
896
897 std::string enzyme_;
898
899 DecoyMode_ decoy_mode_{DecoyMode_::AUTO};
900 std::string decoy_prefix_;
901
902 double fdr_psm_{0.0};
903 double fdr_protein_{0.0};
904
906
910 EnzymaticDigestion::Specificity peptide_enzyme_specificity_{EnzymaticDigestion::SPEC_FULL};
911
912 std::string peptide_motif_;
913
915
916 bool add_a_ions_{false};
917 bool add_b_ions_{true};
918 bool add_c_ions_{false};
919 bool add_x_ions_{false};
920 bool add_y_ions_{true};
921 bool add_z_ions_{false};
922 bool add_zp1_ions_{false};
923 bool ions_by_activation_{true};
924
925 Size database_chunk_size_{0};
926
927 bool calibration_enabled_{false};
928 double calibration_subset_ratio_{0.1};
929 Size calibration_min_psms_{50};
930
939 {
940 double precursor_shift{0};
941 double precursor_spread{0};
942 double cal_lower{0};
943 double cal_upper{0};
944 double fragment_tolerance{0};
945 double fragment_shift{0};
946 bool extreme_bias{false};
947 bool success{false};
948 };
949
954
961
969 mutable double last_mod_match_tolerance_used_{-1.0};
970
982 {
983 if (precursor_mass_tolerance_lower_ <= 0.0) return precursor_mass_tolerance_upper_;
984 if (precursor_mass_tolerance_upper_ <= 0.0) return precursor_mass_tolerance_lower_;
985 return std::min(precursor_mass_tolerance_lower_, precursor_mass_tolerance_upper_);
986 }
987
1002 FragmentIndex& fragment_index,
1003 const std::vector<FASTAFile::FASTAEntry>& db,
1004 const PeakMap* query_spectra = nullptr) const;
1005
1008 static bool accessionHasDecoyMarker_(const std::string& accession,
1009 const std::string& marker, bool is_prefix);
1010
1017 static void capturePreFdrStats_(const PeptideIdentificationList& peptide_ids,
1018 RunStatistics& stats);
1019
1023 static double maxRetainedScore_(const PeptideIdentificationList& peptide_ids);
1024
1030 void collectRunStatistics_(const PeakMap& spectra,
1031 const std::vector<ProteinIdentification>& protein_ids,
1032 const PeptideIdentificationList& peptide_ids,
1033 RunStatistics& stats) const;
1034
1035 public:
1046 const PeptideIdentificationList& peptide_ids,
1047 const std::string& enzyme,
1048 bool fdr_applied);
1049
1054 static void renderRunSummary(const RunStatistics& stats,
1055 const SharedSearchStats& shared,
1057 bool is_open_search,
1058 std::ostream& os);
1059
1063 std::ostream& os);
1064
1071 static std::string renderRunSummaryYaml(
1072 const MultiFileSearchResult& mfres,
1073 const std::vector<std::pair<std::string, std::vector<std::string>>>& manifest,
1074 Size files_failed,
1075 Size files_total);
1076
1077 private:
1078
1081 {
1082 return FragmentIndex::isOpenSearchMode(precursor_mass_tolerance_lower_,
1083 precursor_mass_tolerance_upper_,
1084 precursor_mass_tolerance_unit_ == "ppm");
1085 }
1086};
1087
1088} // namespace
Definition AASequence.h:96
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:41
Generates from a set of Fasta files a 2D-datastructure which stores all theoretical masses of all b a...
Definition FragmentIndex.h:35
In-Memory representation of a mass spectrometry run.
Definition MSExperiment.h:49
The representation of a 1D spectrum.
Definition MSSpectrum.h:44
Combined result of open search modification analysis.
Definition OpenSearchModificationAnalysis.h:104
Management and storage of parameters / INI files.
Definition Param.h:46
Container for peptide identifications from multiple spectra.
Definition PeptideIdentificationList.h:66
Fragment-index-based peptide database search algorithm (experimental).
Definition ProSEAlgorithm.h:52
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 LocalFragmentEvidence_ localFragmentEvidence_(const MSSpectrum &spectrum, const MSSpectrum &theoretical, const std::vector< double > &densities, double tolerance, bool ppm)
Compute local fragment-match evidence on the spectrum before window/top-N peak filtering.
std::string enzyme_
Definition ProSEAlgorithm.h:897
static std::string renderRunSummaryYaml(const MultiFileSearchResult &mfres, const std::vector< std::pair< std::string, std::vector< std::string > > > &manifest, Size files_failed, Size files_total)
FragmentIndex fragment_index
Definition ProSEAlgorithm.h:215
std::string fragment_tol_unit
Definition ProSEAlgorithm.h:116
Size peptide_max_size_
Definition ProSEAlgorithm.h:908
static void updateFinalStats(RunStatistics &stats, const PeptideIdentificationList &peptide_ids, const std::string &enzyme, bool fdr_applied)
SearchResult searchWithModificationAnalysis(const std::string &in_spectra, const std::string &in_db, const std::string &output_base_name="") const
Search with comprehensive results including modification analysis tables.
Size precursor_max_charge_
Definition ProSEAlgorithm.h:865
Size precursor_min_charge_
Definition ProSEAlgorithm.h:864
std::string decoy_prefix_
Definition ProSEAlgorithm.h:900
RunStatistics stats
Definition ProSEAlgorithm.h:150
Size report_top_hits_
Definition ProSEAlgorithm.h:914
Size modifications_max_variable_mods_per_peptide_
Definition ProSEAlgorithm.h:895
static void renderModificationSummary(const OpenSearchModificationAnalysis::OpenSearchAnalysisResult &mod_analysis, std::ostream &os)
SearchResult searchWithModificationAnalysis(PeakMap &spectra, const std::vector< FASTAFile::FASTAEntry > &fasta_db, const std::string &output_base_name="") const
In-memory search with modification analysis: no file I/O required.
std::string peptide_motif_
Definition ProSEAlgorithm.h:912
std::string input_file
spectrum file this run searched (basename or path)
Definition ProSEAlgorithm.h:77
std::map< Int, Size > charge_histogram
precursor charge -> PSM count
Definition ProSEAlgorithm.h:86
SpectrumGenerators_ spectrumGenerators_() const
Generators for scoring, annotation and calibration, configured from the ions:* parameters.
StringList modifications_fixed_
Definition ProSEAlgorithm.h:891
MultiFileSearchResult searchWithModificationAnalysis(const std::vector< std::string > &in_spectra_files, const std::vector< FASTAFile::FASTAEntry > &fasta_db, const std::vector< std::string > &output_base_names={}, const std::string &aggregate_base_name="", bool build_pooled_aggregate=true) const
Multi-file search with modification analysis (in-memory FASTA).
static void capturePreFdrStats_(const PeptideIdentificationList &peptide_ids, RunStatistics &stats)
std::vector< ProteinIdentification > protein_ids
Definition ProSEAlgorithm.h:146
Size peptide_min_size_
Definition ProSEAlgorithm.h:907
std::vector< FASTAFile::FASTAEntry > buildDecoyAugmentedDB_(const std::vector< FASTAFile::FASTAEntry > &fasta_db, const DecoyStrategy_ &strategy) const
Build the searched database according to strategy.
SearchResult aggregate
Definition ProSEAlgorithm.h:188
IntList precursor_isotopes_
Definition ProSEAlgorithm.h:867
MultiFileSearchResult searchWithModificationAnalysis(const std::vector< std::string > &in_spectra_files, const std::string &in_db, const std::vector< std::string > &output_base_names={}, const std::string &aggregate_base_name="", bool build_pooled_aggregate=true) const
Multi-file search with modification analysis (FASTA file path).
std::string database_file
FASTA path (empty for in-memory db)
Definition ProSEAlgorithm.h:111
CalibrationResult_ runCalibrationPass_(PeakMap &spectra, FragmentIndex &fragment_index, const std::vector< FASTAFile::FASTAEntry > &db, const PeakMap *query_spectra=nullptr) const
Run a fast calibration pass on a subset of spectra to estimate mass accuracy.
std::string strip_string
marker of pre-existing decoys to strip
Definition ProSEAlgorithm.h:650
std::map< Size, Size > missed_cleavage_histogram
missed cleavages -> PSM count
Definition ProSEAlgorithm.h:87
RunStatistics last_run_stats_
Definition ProSEAlgorithm.h:960
std::string fragment_mass_tolerance_unit_
Definition ProSEAlgorithm.h:871
StringList annotate_psm_
Definition ProSEAlgorithm.h:905
static void filterLocalPeaks_(MSSpectrum &spectrum, Size peaks_per_window)
Keep the strongest peaks in each non-overlapping 100 Da window, including a short final window.
static void applyCompleteSetProteinFDR(std::vector< ProteinIdentification > &protein_ids, PeptideIdentificationList &peptide_ids, const std::string &decoy_string, bool decoy_is_prefix, double protein_fdr)
Finalize protein-level FDR on a COMPLETE protein set (a single input file, or a merged cross-file agg...
Param fragmentIndexParameters_(bool electron_ions=false) const
ProSE parameters made safe to hand to a FragmentIndex.
OpenSearchModificationAnalysis::OpenSearchAnalysisResult modification_analysis
Definition ProSEAlgorithm.h:148
ExitCodes search(const std::string &in_spectra, const std::string &in_db, std::vector< ProteinIdentification > &prot_ids, PeptideIdentificationList &pep_ids) const
Search spectra in a spectrum file (mzML or Bruker .d) against a protein database using an FI-backed w...
std::vector< FASTAFile::FASTAEntry > db
Definition ProSEAlgorithm.h:214
static bool accessionHasDecoyMarker_(const std::string &accession, const std::string &marker, bool is_prefix)
static void renderRunSummary(const RunStatistics &stats, const SharedSearchStats &shared, const OpenSearchModificationAnalysis::OpenSearchAnalysisResult &mod_analysis, bool is_open_search, std::ostream &os)
ExitCodes search(PeakMap &spectra, SearchContext &ctx, std::vector< ProteinIdentification > &prot_ids, PeptideIdentificationList &pep_ids) const
In-memory search using a pre-built SearchContext.
SharedSearchStats shared
Definition ProSEAlgorithm.h:201
bool isOpenSearchMode_() const
Helper function to determine if open search should be used based on tolerance.
Definition ProSEAlgorithm.h:1080
ExitCodes searchChunked_(PeakMap &spectra, std::vector< FASTAFile::FASTAEntry > &full_db, const DecoyStrategy_ &strategy, std::vector< ProteinIdentification > &protein_ids, PeptideIdentificationList &peptide_ids) const
Chunked database search implementation.
std::string decoy_string
Definition ProSEAlgorithm.h:193
DecoyStrategy_ resolveDecoyStrategy_(const std::vector< FASTAFile::FASTAEntry > &db) const
Decide how to obtain/recognise decoys for db.
Size countElectronActivated_(const PeakMap &spectra) const
Number of spectra that ions:by_activation also scores with c and z+1 ions (0 if it is off)
std::vector< FASTAFile::FASTAEntry > buildCalibrationSample_(const std::vector< FASTAFile::FASTAEntry > &full_db) const
Build a strided protein sample for chunked calibration.
static std::vector< double > localPeakDensities_(const MSSpectrum &spectrum)
Peak counts per Da in a fixed +/-50 m/z window around each peak of a sorted spectrum.
void scoreSpectraAgainstIndex_(const PeakMap &spectra, FragmentIndex &fi, const std::vector< FASTAFile::FASTAEntry > &db, const SpectrumGenerators_ &generators, double effective_fragment_tol, bool fragment_mass_tolerance_unit_ppm, bool open_search_mode, std::vector< std::vector< AnnotatedHit_ > > &annotated_hits, std::vector< CandidatePoolStats_ > &pool_stats, const std::string &progress_label, const PeakMap *query_spectra=nullptr) const
Score all spectra against one FragmentIndex.
static bool isElectronActivated_(const MSSpectrum &spectrum)
True if the precursor of spectrum was activated by electrons (ETD, ECD, EThcD or ETciD)
std::string decoy_mode
"generated" | "external" | "none (target-only)"
Definition ProSEAlgorithm.h:124
PeptideIdentificationList peptide_ids
Definition ProSEAlgorithm.h:147
std::string enzyme
Definition ProSEAlgorithm.h:112
void updateMembers_() override
This method is used to update extra member variables at the end of the setParameters() method.
void postProcessHits_(const PeakMap &exp, std::vector< std::vector< ProSEAlgorithm::AnnotatedHit_ > > &annotated_hits, const std::vector< CandidatePoolStats_ > &pool_stats, 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 std::string &precursor_mass_tolerance_unit_ppm, const std::string &fragment_mass_tolerance_unit_ppm, const Int precursor_min_charge, const Int precursor_max_charge, const std::string &enzyme, const std::string &database_name, const PeakMap *evidence_spectra=nullptr) const
Filter and annotate search results.
ExitCodes
Exit codes.
Definition ProSEAlgorithm.h:58
StringList modifications_variable_
Definition ProSEAlgorithm.h:893
static double maxRetainedScore_(const PeptideIdentificationList &peptide_ids)
std::vector< SearchResult > per_file
Definition ProSEAlgorithm.h:187
double fragment_mass_tolerance_
Definition ProSEAlgorithm.h:869
SearchContext prepareContext(const std::vector< FASTAFile::FASTAEntry > &fasta_db) const
Build a SearchContext (decoy-augmented database + FragmentIndex) for reuse.
static void preprocessSpectra_(PeakMap &exp, double fragment_mass_tolerance, bool fragment_mass_tolerance_unit_ppm, bool deisotope_requested, Size peaks_keep_n, Int peaks_window_top, const std::string &window_type="auto", PeakMap *evidence_spectra=nullptr, PeakMap *query_spectra=nullptr)
Filter, deisotope and decharge spectra.
int scoringMaxCharge_(int precursor_charge) const
Fragment charges that score a candidate of the given precursor charge; also used by the calibration p...
Definition ProSEAlgorithm.h:882
SearchContext prepareContext(const std::vector< FASTAFile::FASTAEntry > &fasta_db, bool electron_ions) const
Build a SearchContext whose FragmentIndex also holds c and z+1 ions.
Size peptide_missed_cleavages_
Definition ProSEAlgorithm.h:909
CalibrationResult_ last_calibration_result_
Definition ProSEAlgorithm.h:953
double computeModMatchTolerance_() const
Definition ProSEAlgorithm.h:981
void collectRunStatistics_(const PeakMap &spectra, const std::vector< ProteinIdentification > &protein_ids, const PeptideIdentificationList &peptide_ids, RunStatistics &stats) const
std::vector< std::string > fixed_mods
Definition ProSEAlgorithm.h:119
std::string precursor_tol_unit
Definition ProSEAlgorithm.h:114
DecoyMode_
How decoys are obtained/recognised for a search (parameter "decoys").
Definition ProSEAlgorithm.h:630
Result of a calibration pass.
Definition ProSEAlgorithm.h:939
Resolved decoy handling for one concrete input database.
Definition ProSEAlgorithm.h:644
Local fragment evidence of one candidate (annotate:local_fragment_evidence).
Definition ProSEAlgorithm.h:688
Multi-file search result bundle.
Definition ProSEAlgorithm.h:186
Per-run identification statistics for the end-of-search report.
Definition ProSEAlgorithm.h:76
Prepared per-database state shared across multiple spectrum files.
Definition ProSEAlgorithm.h:213
Comprehensive search result including modification analysis.
Definition ProSEAlgorithm.h:144
Configuration, database and fragment-index facts shared across all input files of one ProSE invocatio...
Definition ProSEAlgorithm.h:110
Base class for all classes that want to report their progress.
Definition ProgressLogger.h:27
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 TypeAliases.h:24
std::vector< std::string > StringList
Vector of String.
Definition TypeAliases.h:39
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 ProSEAlgorithm.h:516
static bool hasBetterScore(const AnnotatedHit_ &a, const AnnotatedHit_ &b)
Definition ProSEAlgorithm.h:533
double score
main score
Definition ProSEAlgorithm.h:523
AASequence sequence
Definition ProSEAlgorithm.h:517
Running summary of the complete candidate pool of one spectrum.
Definition ProSEAlgorithm.h:560
std::unordered_set< std::string > seen_candidates
Definition ProSEAlgorithm.h:568
void add(double score)
Fold one freshly scored candidate into the summary.
Definition ProSEAlgorithm.h:571
double deltaScore() const
Best minus runner-up over the full pool.
Definition ProSEAlgorithm.h:581
double zScore() const
How much of an outlier the best score is within its own candidate pool.