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
22
23#include <algorithm> // std::min (used by inline computeModMatchTolerance_)
24#include <functional> // std::hash (ProteinMapping_), std::function (loadSpectra)
25#include <iosfwd> // std::ostream (renderRunSummary / renderModificationSummary)
26#include <limits>
27#include <map>
28#include <string> // std::string (renderRunSummaryJson return / manifest)
29#include <string_view>
30#include <unordered_map>
31#include <unordered_set>
32#include <utility> // std::pair (renderRunSummaryJson manifest)
33#include <vector>
34
35namespace OpenMS
36{
37
38class TheoreticalSpectrumGenerator;
39
54class OPENMS_DLLAPI ProSEAlgorithm :
56 public ProgressLogger
57{
58 public:
60
63 static constexpr const char* CHIMERIC_RANK = "chimeric_rank";
64
67 static constexpr double MIN_DECOYS_PER_TARGET = 0.5;
69 static constexpr double MAX_DECOYS_PER_TARGET = 2.0;
70
72 enum class ExitCodes
73 {
74 EXECUTION_OK,
75 INPUT_FILE_EMPTY,
76 UNEXPECTED_RESULT,
77 UNKNOWN_ERROR,
78 ILLEGAL_PARAMETERS
79 };
80
91 {
92 std::string input_file;
93 Size ms2_spectra = 0;
94 Size profile_spectra = 0;
95 Size charge_out_of_range_spectra = 0;
96 Size matched_spectra = 0;
97 Size target_psms = 0;
98 Size decoy_psms = 0;
99 bool fdr_applied = false;
100 double achieved_psm_fdr = -1.0;
101 Size unique_peptides = 0;
102 Size unique_proteins = 0;
103 std::map<Int, Size> charge_histogram;
104 std::map<Size, Size> missed_cleavage_histogram;
105 bool score_stats_valid = false;
106 double hyperscore_min = 0.0;
107 double hyperscore_median = 0.0;
108 double hyperscore_max = 0.0;
113 bool prec_tol_valid = false;
114 double prec_err_median = 0.0, prec_err_mad = 0.0, prec_err_recommended = 0.0;
117 bool frag_tol_valid = false;
118 double frag_err_median = 0.0, frag_err_mad = 0.0, frag_err_recommended = 0.0;
119 double seconds_search = 0.0;
120 double seconds_calibration = 0.0;
121 double seconds_fdr = 0.0;
122 };
123
133 {
134 std::string database_file;
135 std::string enzyme;
136 double precursor_tol_lower = 0.0, precursor_tol_upper = 0.0;
138 double fragment_tol = 0.0;
139 std::string fragment_tol_unit;
140 Int min_charge = 0, max_charge = 0;
141 Size missed_cleavages = 0;
142 std::vector<std::string> fixed_mods, variable_mods, ion_series;
143 bool open_search = false;
144 bool calibration_enabled = false;
145 bool peptide_mass_mode = false;
146 bool chunked = false;
147 std::string decoy_mode;
148 double psm_fdr_threshold = 0.0, protein_fdr_threshold = 0.0;
149 Size db_target_proteins = 0;
150 Size db_decoy_proteins = 0;
151 Size indexed_peptides = 0;
152 Size indexed_fragments = 0;
153 double seconds_index_build = 0.0;
154 double seconds_total = 0.0;
155 double seconds_output = 0.0;
156 double seconds_qpx_extended = 0.0;
157 };
158
165 {
167 bool applied = false;
169 std::string skipped_reason;
172 std::string warning;
173 };
174
202
245 {
246 std::vector<SearchResult> per_file;
248
252 std::string decoy_string;
254 bool decoy_is_prefix = true;
256 bool have_decoys = false;
257
261 };
262
265 {
266 std::vector<ProteinIdentification> protein_ids;
270 bool protein_fdr_applied = false;
271 };
272
282 {
283 std::vector<FASTAFile::FASTAEntry> db;
285
295 bool release_fragment_index_after_scoring = false;
296
301 std::string decoy_string;
303 bool decoy_is_prefix = true;
306 bool have_decoys = false;
311 bool electron_ions = false;
312 };
313
335 ExitCodes search(const std::string& in_spectra,
336 const std::string& in_db,
337 std::vector<ProteinIdentification>& prot_ids,
338 PeptideIdentificationList& pep_ids) const;
339
390 static bool applyCompleteSetProteinFDR(std::vector<ProteinIdentification>& protein_ids,
391 PeptideIdentificationList& peptide_ids,
392 const std::string& decoy_string,
393 bool decoy_is_prefix,
394 double protein_fdr,
395 bool remove_decoys,
396 const PeptideIdentificationList& inference_only_psms);
397
416 static std::string inferProteins(std::vector<ProteinIdentification>& protein_ids,
417 const PeptideIdentificationList& peptide_ids,
418 const PeptideIdentificationList& inference_only_psms = PeptideIdentificationList());
419
428 static void removeUnreportedProteins(std::vector<ProteinIdentification>& protein_ids,
429 const PeptideIdentificationList& peptide_ids,
430 const PeptideIdentificationList& also_referencing = PeptideIdentificationList());
431
445 static Size removeDuplicateProteins(std::vector<FASTAFile::FASTAEntry>& db, const std::string& source);
446
459
495 static PercolatorRescoring rescoreWithPercolator(std::vector<ProteinIdentification>& protein_ids,
496 PeptideIdentificationList& peptide_ids,
497 int threads,
498 Size max_train_psms = 0);
499
515 static PeakMap loadSpectra(const std::string& filename, const std::function<bool(const MSSpectrum&)>& keep = {});
516
544 bool applyDeferredPsmFDR(const std::vector<ProteinIdentification>& protein_ids,
545 PeptideIdentificationList& peptide_ids,
546 bool rescored,
547 double psm_fdr,
548 PeptideIdentificationList* inference_only_psms = nullptr) const;
549
596 SearchResult searchWithModificationAnalysis(const std::string& in_spectra,
597 const std::string& in_db,
598 const std::string& output_base_name = "") const;
599
618 const std::vector<FASTAFile::FASTAEntry>& fasta_db,
619 std::vector<ProteinIdentification>& prot_ids,
620 PeptideIdentificationList& pep_ids) const;
621
642 SearchContext prepareContext(const std::vector<FASTAFile::FASTAEntry>& fasta_db) const;
643
657 SearchContext prepareContext(const std::vector<FASTAFile::FASTAEntry>& fasta_db, bool electron_ions) const;
658
680 SearchContext& ctx,
681 std::vector<ProteinIdentification>& prot_ids,
682 PeptideIdentificationList& pep_ids) const;
683
695 const std::vector<FASTAFile::FASTAEntry>& fasta_db,
696 const std::string& output_base_name = "") const;
697
749 const std::vector<std::string>& in_spectra_files,
750 const std::vector<FASTAFile::FASTAEntry>& fasta_db,
751 const std::vector<std::string>& output_base_names = {},
752 const std::string& aggregate_base_name = "",
753 bool build_pooled_aggregate = true) const;
754
769 const std::vector<std::string>& in_spectra_files,
770 const std::string& in_db,
771 const std::vector<std::string>& output_base_names = {},
772 const std::string& aggregate_base_name = "",
773 bool build_pooled_aggregate = true) const;
774
828 bool remove_decoys = true) const;
829
852
856 void setParameterNamePrefix(const std::string& prefix) { parameter_name_prefix_ = prefix; }
857
861 void setKeepPreFdrPsms(bool keep)
862 {
863 keep_pre_fdr_psms_ = keep;
864 if (!keep) { pre_fdr_peptide_ids_ = PeptideIdentificationList(); }
865 }
866
867 protected:
868 void updateMembers_() override;
869
872 {
874 /*
875 std::string_view sequence;
876 SignedSize peptide_mod_index; ///< enumeration index of the non-RNA peptide modification
877 */
878 // Layout: doubles first, then floats, then int, then uint16_t — minimizes padding (40 bytes excluding AASequence)
879 double score = 0;
880 double delta_mass = 0.0;
881 float prefix_fraction = 0;
882 float suffix_fraction = 0;
883 float mean_error = 0.0f;
884 int isotope_error = 0;
885 uint16_t applied_charge = 0;
886 uint16_t matched_prefix_ions = 0;
887 uint16_t matched_suffix_ions = 0;
888 UInt32 index_peptide = 0;
889
890 static bool hasBetterScore(const AnnotatedHit_& a, const AnnotatedHit_& b)
891 {
892 if (a.score != b.score) return a.score > b.score;
893 return a.sequence < b.sequence;
894 }
895 };
896
917 {
918 double sum = 0.0;
919 double sumsq = 0.0;
920 double best = 0.0;
921 double second_best = 0.0;
922 Size count = 0;
925 std::unordered_set<std::string> seen_candidates;
926
928 void add(double score)
929 {
930 if (score > best) { second_best = best; best = score; }
931 else if (score > second_best) { second_best = score; }
932 sum += score;
933 sumsq += score * score;
934 ++count;
935 }
936
938 double deltaScore() const { return best - second_best; }
939
961 double zScore() const;
962 };
963
973 {
974 unsigned int min_peaks{3};
975 bool charge_cap_precursor{false};
976 bool sum_intensity{false};
977 };
978
993 static void preprocessSpectra_(PeakMap& exp,
994 double fragment_mass_tolerance,
995 bool fragment_mass_tolerance_unit_ppm,
996 bool deisotope_requested,
997 Size peaks_keep_n,
998 Int peaks_window_top,
999 const std::string& window_type,
1000 const DeisotopingSettings_& deisotoping,
1001 FragmentIonLikelihoodModel::PeakLists* ion_evidence = nullptr,
1002 bool ion_evidence_scored_peaks = false,
1003 PeakMap* evidence_spectra = nullptr,
1004 PeakMap* query_spectra = nullptr);
1005
1007 static void preprocessSpectra_(PeakMap& exp,
1008 double fragment_mass_tolerance,
1009 bool fragment_mass_tolerance_unit_ppm,
1010 bool deisotope_requested,
1011 Size peaks_keep_n,
1012 Int peaks_window_top,
1013 const std::string& window_type = "auto");
1014
1041 void annotateIonPriors_(const PeakMap& spectra,
1043 std::vector<ProteinIdentification>& protein_ids,
1044 PeptideIdentificationList& peptide_ids) const;
1045
1048
1050 static void filterLocalPeaks_(MSSpectrum& spectrum, Size peaks_per_window);
1051
1053 enum class DecoyMode_
1054 {
1055 AUTO,
1056 GENERATE,
1057 IGNORE
1058 };
1059
1068 {
1069 bool generate{false};
1070 bool strip_existing{false};
1071 bool have_decoys{false};
1072 std::string decoy_string;
1073 bool is_prefix{true};
1074 std::string strip_string;
1075 bool strip_is_prefix{true};
1076 };
1077
1087 const std::vector<FASTAFile::FASTAEntry>& db) const;
1088
1101 Param fragmentIndexParameters_(bool electron_ions = false) const;
1102
1105 struct SpectrumGenerators_;
1106
1108 SpectrumGenerators_ spectrumGenerators_() const;
1109
1112 {
1113 double chance_match_surprise = 0.0;
1114 double mass_competition_evidence = 0.0;
1115 };
1116
1118 static std::vector<double> localPeakDensities_(const MSSpectrum& spectrum);
1119
1139 const MSSpectrum& theoretical,
1140 const std::vector<double>& densities,
1141 double tolerance, bool ppm);
1142
1146 const MSSpectrum& theoretical,
1147 int max_charge,
1148 const std::vector<double>& densities,
1149 double tolerance, bool ppm,
1150 std::vector<double>& alternatives);
1151
1153 static bool isElectronActivated_(const MSSpectrum& spectrum);
1154
1156 Size countElectronActivated_(const PeakMap& spectra) const;
1157
1165 std::vector<FASTAFile::FASTAEntry> buildDecoyAugmentedDB_(
1166 const std::vector<FASTAFile::FASTAEntry>& fasta_db,
1167 const DecoyStrategy_& strategy) const;
1168
1170 std::vector<FASTAFile::FASTAEntry> buildDecoyAugmentedDB_(
1171 std::vector<FASTAFile::FASTAEntry>&& fasta_db,
1172 const DecoyStrategy_& strategy) const;
1173
1177 SearchContext prepareContext_(std::vector<FASTAFile::FASTAEntry>&& fasta_db, bool electron_ions,
1178 const std::function<const PeakMap*(Size)>& searched_spectra = {}) const;
1179
1183 bool restrictIndexToSpectra_() const { return !calibration_enabled_ && !chimeric_enabled_; }
1184
1187 bool chimericSearch_() const { return chimeric_enabled_ && database_chunk_size_ == 0; }
1188
1191 {
1192 Size parent = 0;
1194 std::vector<UInt32> removed;
1195 };
1196
1221 void searchCoIsolated_(const PeakMap& spectra,
1222 const std::vector<std::vector<AnnotatedHit_>>& annotated_hits,
1223 FragmentIndex& fi,
1224 const std::vector<FASTAFile::FASTAEntry>& db,
1225 const SpectrumGenerators_& generators,
1226 double fragment_tol,
1227 bool fragment_tol_ppm,
1228 bool open_search_mode,
1229 std::vector<CoIsolatedPSM_>& psms,
1230 std::vector<std::vector<AnnotatedHit_>>& hits,
1231 std::vector<CandidatePoolStats_>& pool_stats) const;
1232
1235 static MSSpectrum residualSpectrum_(const MSSpectrum& spectrum, const std::vector<UInt32>& removed, const Precursor& precursor);
1236
1250 std::vector<FASTAFile::FASTAEntry> buildCalibrationSample_(
1251 const std::vector<FASTAFile::FASTAEntry>& full_db) const;
1252
1267 PeakMap& spectra,
1268 std::vector<FASTAFile::FASTAEntry>& full_db,
1269 const DecoyStrategy_& strategy,
1270 std::vector<ProteinIdentification>& protein_ids,
1271 PeptideIdentificationList& peptide_ids) const;
1272
1298 const PeakMap& spectra,
1299 FragmentIndex& fi,
1300 const std::vector<FASTAFile::FASTAEntry>& db,
1301 const SpectrumGenerators_& generators,
1302 double effective_fragment_tol,
1303 bool fragment_mass_tolerance_unit_ppm,
1304 bool open_search_mode,
1305 std::vector<std::vector<AnnotatedHit_>>& annotated_hits,
1306 std::vector<CandidatePoolStats_>& pool_stats,
1307 const std::string& progress_label,
1308 const PeakMap* query_spectra = nullptr) const;
1309
1342 void postProcessHits_(const PeakMap& exp,
1343 std::vector<std::vector<ProSEAlgorithm::AnnotatedHit_> >& annotated_hits,
1344 const std::vector<CandidatePoolStats_>& pool_stats,
1345 std::vector<ProteinIdentification>& protein_ids,
1346 PeptideIdentificationList& peptide_ids,
1347 Size top_hits,
1348 const StringList& modifications_fixed,
1349 const StringList& modifications_variable,
1350 Int peptide_missed_cleavages,
1351 double precursor_mass_tolerance,
1352 double fragment_mass_tolerance,
1353 const std::string& precursor_mass_tolerance_unit_ppm,
1354 const std::string& fragment_mass_tolerance_unit_ppm,
1355 const Int precursor_min_charge,
1356 const Int precursor_max_charge,
1357 const std::string& enzyme,
1358 const std::string& database_name,
1359 const PeakMap* evidence_spectra = nullptr,
1360 const std::vector<Size>* evidence_parent = nullptr) const;
1361
1370 std::vector<ProteinIdentification>& protein_ids,
1371 PeptideIdentificationList& peptide_ids) const;
1372
1373 bool peptdeep_enable_{false};
1376 std::string peptdeep_instrument_{"QE"};
1377 double peptdeep_nce_{-1.0};
1378 std::string peptdeep_rt_model_type_{"b_spline"};
1379 int peptdeep_batch_size_{500};
1380
1384 mutable double precursor_mass_tolerance_lower_{10.0};
1385 mutable double precursor_mass_tolerance_upper_{10.0};
1386 std::string precursor_mass_tolerance_unit_{"ppm"};
1387
1390
1392
1394
1399 bool deisotope_requested_{true};
1400 bool scoring_multiple_charges_{false};
1401 int scoring_max_charge_{2};
1402 bool mass_accuracy_score_{false};
1403 double mass_error_sd_ppm_{7.0};
1404
1406 int scoringMaxCharge_(int precursor_charge) const
1407 {
1408 return scoring_multiple_charges_ ? std::max(1, std::min(precursor_charge - 1, scoring_max_charge_)) : 1;
1409 }
1410 Size peaks_keep_n_{0};
1411 Int peaks_window_top_{20};
1412 std::string peaks_window_type_ {"auto"};
1414 bool query_raw_spectrum_{false};
1415
1417
1419
1421
1422 std::string enzyme_;
1423
1424 DecoyMode_ decoy_mode_{DecoyMode_::AUTO};
1425 std::string decoy_prefix_;
1426
1427 bool rescore_{true};
1428 Size max_train_psms_{500000};
1429 double fdr_psm_{0.0};
1430 bool fdr_psm_by_scored_charges_{true};
1431 double fdr_protein_{0.0};
1432 double fdr_protein_inference_psm_{0.1};
1433
1435
1436 bool self_trained_ion_priors_{false};
1437 FragmentIonLikelihoodModel::ContextSet ion_prior_model_{FragmentIonLikelihoodModel::ContextSet::RICH};
1438 bool ion_prior_scored_peaks_{false};
1439 int ion_prior_max_fragment_charge_{2};
1440 double ion_prior_train_fdr_{0.01};
1441 Size ion_prior_min_psms_{100};
1442 bool ion_prior_feature_llr_{true};
1443 bool ion_prior_feature_explained_{true};
1444 bool ion_prior_feature_topk_{false};
1445
1449 EnzymaticDigestion::Specificity peptide_enzyme_specificity_{EnzymaticDigestion::SPEC_FULL};
1450
1451
1455 bool isotope_error_observed_minus_theoretical_{true};
1456
1457 bool add_a_ions_{false};
1458 bool add_b_ions_{true};
1459 bool add_c_ions_{false};
1460 bool add_x_ions_{false};
1461 bool add_y_ions_{true};
1462 bool add_z_ions_{false};
1463 bool add_zp1_ions_{false};
1464 bool ions_by_activation_{true};
1465 bool protein_mapping_from_index_{true};
1466
1467 Size database_chunk_size_{0};
1468
1469 bool calibration_enabled_{false};
1470 double calibration_subset_ratio_{0.1};
1471 bool chimeric_enabled_{false};
1472 Size calibration_min_psms_{50};
1473
1482 {
1483 double precursor_shift{0};
1484 double precursor_spread{0};
1485 double cal_lower{0};
1486 double cal_upper{0};
1487 double fragment_tolerance{0};
1488 double fragment_shift{0};
1489 bool extreme_bias{false};
1490 bool success{false};
1491 };
1492
1497
1504
1508 bool keep_pre_fdr_psms_ = false;
1511 std::string paramName_(const std::string& name) const { return parameter_name_prefix_ + name; }
1516 mutable bool pool_rescoring_ = false;
1518 bool keepPreRescoringPsms_() const { return keep_pre_fdr_psms_ || pool_rescoring_; }
1525
1533 mutable double last_mod_match_tolerance_used_{-1.0};
1534
1546 {
1547 if (precursor_mass_tolerance_lower_ <= 0.0) return precursor_mass_tolerance_upper_;
1548 if (precursor_mass_tolerance_upper_ <= 0.0) return precursor_mass_tolerance_lower_;
1549 return std::min(precursor_mass_tolerance_lower_, precursor_mass_tolerance_upper_);
1550 }
1551
1566 FragmentIndex& fragment_index,
1567 const std::vector<FASTAFile::FASTAEntry>& db,
1568 const PeakMap* query_spectra = nullptr) const;
1569
1588 {
1590 static constexpr Size SHARDS = 64;
1592 std::vector<std::string_view> sequences;
1594 std::vector<std::vector<std::pair<UInt32, UInt32>>> occurrences;
1596 std::vector<std::unordered_map<std::string_view, Size>> entries;
1598 std::string fallback_reason;
1599
1601 Size find(std::string_view sequence) const
1602 {
1603 if (entries.empty()) return sequences.size();
1604 const auto& table = entries[std::hash<std::string_view>{}(sequence) % SHARDS];
1605 const auto entry = table.find(sequence);
1606 return entry == table.end() ? sequences.size() : entry->second;
1607 }
1608 };
1609
1620 const std::vector<FASTAFile::FASTAEntry>& db,
1621 std::vector<UInt32> candidates,
1622 const Param& indexer_parameters);
1623
1632 static bool applyProteinMapping_(const ProteinMapping_& mapping,
1633 const std::vector<FASTAFile::FASTAEntry>& db,
1634 const Param& indexer_parameters,
1635 std::vector<ProteinIdentification>& protein_ids,
1636 PeptideIdentificationList& peptide_ids,
1637 std::string& fallback_reason);
1638
1641 static bool accessionHasDecoyMarker_(const std::string& accession,
1642 const std::string& marker, bool is_prefix);
1643
1647 static void removeProteinsReferencedByNeither_(std::vector<ProteinIdentification>& protein_ids,
1648 const PeptideIdentificationList& peptide_ids,
1649 const PeptideIdentificationList& also_referencing);
1650
1653 static constexpr const char* SEARCH_ENGINE_SCORE = "ln(hyperscore)";
1654
1660
1662 static Size countDecoyEntries_(const std::vector<FASTAFile::FASTAEntry>& db, const std::string& marker, bool is_prefix);
1663
1671 static void poolSearchedFiles_(std::vector<SearchResult>& per_file, bool move_psms, const StringList& in_spectra_files,
1672 std::vector<ProteinIdentification>& protein_ids, PeptideIdentificationList& peptide_ids);
1673
1675 static bool searched_(const SearchResult& pf);
1676
1679 static int searchedFileOf_(const PeptideIdentification& id, const std::vector<SearchResult>& per_file);
1680
1684 static void returnPooledPsms_(PeptideIdentificationList& pooled, std::vector<SearchResult>& per_file);
1685
1692 static void capturePreFdrStats_(const PeptideIdentificationList& peptide_ids,
1693 RunStatistics& stats);
1694
1698 static double maxRetainedScore_(const PeptideIdentificationList& peptide_ids);
1699
1709 PercolatorRescoring applyPsmFDR_(std::vector<ProteinIdentification>& protein_ids,
1710 PeptideIdentificationList& peptide_ids,
1711 bool has_decoys,
1712 RunStatistics& stats,
1713 PeptideIdentificationList* pre_fdr_psms = nullptr,
1714 PeptideIdentificationList* inference_only_psms = nullptr) const;
1715
1718 static StringList percolatorFeatureSet_(const ProteinIdentification& run, int min_charge, int max_charge);
1719
1721 static Param percolatorParameters_(int threads, Size max_train_psms);
1722
1724 static void markRescoredByPercolator_(std::vector<ProteinIdentification>& protein_ids, const Param& pp);
1725
1727 static bool hasPSMs_(const PeptideIdentificationList& ids);
1728
1733 static void tdcQValues_(PeptideIdentificationList& peptide_ids, bool plus_one = false);
1734
1737 static std::vector<Size> stratifiedQuotas_(const std::vector<Size>& sizes, Size cap);
1738
1740 static bool rescoredOnItsOwn_(const SearchResult& pf);
1741
1745 {
1746 Size psms = 0;
1747 int min_charge = std::numeric_limits<int>::max();
1748 int max_charge = std::numeric_limits<int>::min();
1752 std::vector<Size> draw;
1753 };
1754
1766 void limitPreRescoringPsms_(std::vector<SearchResult>& per_file, Size i, std::vector<TransferStratum_>& strata) const;
1767
1785 void rescoreFilesTogether_(MultiFileSearchResult& mfres, const std::vector<std::string>& in_spectra_files,
1786 const std::vector<TransferStratum_>& strata) const;
1787
1790 void collectInferenceOnlyPsms_(const PeptideIdentificationList& peptide_ids, double psm_fdr,
1791 PeptideIdentificationList& inference_only_psms) const;
1792
1798 void collectRunStatistics_(const PeakMap& spectra,
1799 const std::vector<ProteinIdentification>& protein_ids,
1800 const PeptideIdentificationList& peptide_ids,
1801 RunStatistics& stats) const;
1802
1806 {
1807 Size ms2 = 0;
1808 Size profile = 0;
1809 Size charge_out_of_range = 0;
1810 };
1811
1813 SpectraCounts_ countSpectra_(const PeakMap& spectra) const;
1814
1819 void preprocessSearchedSpectra_(PeakMap& spectra, const std::string& input,
1821 PeakMap* evidence_spectra, PeakMap* query_spectra) const;
1822
1823 public:
1834 const PeptideIdentificationList& peptide_ids,
1835 const std::string& enzyme,
1836 bool fdr_applied);
1837
1844 static std::string renderTotalTime(const SharedSearchStats& sh);
1845
1850 static void renderRunSummary(const RunStatistics& stats,
1851 const SharedSearchStats& shared,
1853 bool is_open_search,
1854 std::ostream& os);
1855
1859 std::ostream& os);
1860
1867 static std::string renderRunSummaryYaml(
1868 const MultiFileSearchResult& mfres,
1869 const std::vector<std::pair<std::string, std::vector<std::string>>>& manifest,
1870 Size files_failed,
1871 Size files_total);
1872
1873 private:
1874
1877 {
1878 return FragmentIndex::isOpenSearchMode(precursor_mass_tolerance_lower_,
1879 precursor_mass_tolerance_upper_,
1880 precursor_mass_tolerance_unit_ == "ppm");
1881 }
1882};
1883
1884} // 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:36
Compact peak lists of the spectra of one run: per peak only its m/z and its intensity-rank bin.
Definition FragmentIonLikelihoodModel.h:82
ContextSet
Ion contexts and outcomes the model distinguishes.
Definition FragmentIonLikelihoodModel.h:60
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:106
Management and storage of parameters / INI files.
Definition Param.h:46
Container for peptide identifications from multiple spectra.
Definition PeptideIdentificationList.h:66
Represents the set of candidates (SpectrumMatches) identified for a single precursor spectrum.
Definition PeptideIdentification.h:66
Precursor meta information.
Definition Precursor.h:37
Fragment-index-based peptide database search algorithm (experimental).
Definition ProSEAlgorithm.h:57
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.
static Size countDecoyEntries_(const std::vector< FASTAFile::FASTAEntry > &db, const std::string &marker, bool is_prefix)
Helper: the entries of db whose accession carries the decoy marker (accessionHasDecoyMarker_())
static std::vector< Size > stratifiedQuotas_(const std::vector< Size > &sizes, Size cap)
std::string enzyme_
Definition ProSEAlgorithm.h:1422
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)
static MSSpectrum residualSpectrum_(const MSSpectrum &spectrum, const std::vector< UInt32 > &removed, const Precursor &precursor)
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, const DeisotopingSettings_ &deisotoping, FragmentIonLikelihoodModel::PeakLists *ion_evidence=nullptr, bool ion_evidence_scored_peaks=false, PeakMap *evidence_spectra=nullptr, PeakMap *query_spectra=nullptr)
filter, deisotope, decharge spectra
PercolatorRescoring last_percolator_
Definition ProSEAlgorithm.h:1507
static std::string inferProteins(std::vector< ProteinIdentification > &protein_ids, const PeptideIdentificationList &peptide_ids, const PeptideIdentificationList &inference_only_psms=PeptideIdentificationList())
The protein inference of the protein FDR (applyCompleteSetProteinFDR()) and of mergeFileResults().
FragmentIndex fragment_index
Definition ProSEAlgorithm.h:284
std::string fragment_tol_unit
Definition ProSEAlgorithm.h:139
Size peptide_max_size_
Definition ProSEAlgorithm.h:1447
static void updateFinalStats(RunStatistics &stats, const PeptideIdentificationList &peptide_ids, const std::string &enzyme, bool fdr_applied)
PercolatorRescoring percolator
Outcome of the Percolator rescoring of this run (parameter 'rescore')
Definition ProSEAlgorithm.h:193
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")
preprocessSpectra_() with the DeisotopingSettings_ defaults (the behaviour before its parameters exis...
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.
void rescoreFilesTogether_(MultiFileSearchResult &mfres, const std::vector< std::string > &in_spectra_files, const std::vector< TransferStratum_ > &strata) const
The end of a multi-file search with 'rescore' (with pool_rescoring_), for the files with PSMs that Pe...
Size precursor_max_charge_
Definition ProSEAlgorithm.h:1389
bool applyDeferredPsmFDR(const std::vector< ProteinIdentification > &protein_ids, PeptideIdentificationList &peptide_ids, bool rescored, double psm_fdr, PeptideIdentificationList *inference_only_psms=nullptr) const
Apply the PSM-level FDR to PSMs that were rescored separately, e.g. with rescoreWithPercolator() on t...
Size precursor_min_charge_
Definition ProSEAlgorithm.h:1388
std::string decoy_prefix_
Definition ProSEAlgorithm.h:1425
RunStatistics stats
Definition ProSEAlgorithm.h:191
PercolatorRescoring applyPsmFDR_(std::vector< ProteinIdentification > &protein_ids, PeptideIdentificationList &peptide_ids, bool has_decoys, RunStatistics &stats, PeptideIdentificationList *pre_fdr_psms=nullptr, PeptideIdentificationList *inference_only_psms=nullptr) const
void setParameterNamePrefix(const std::string &prefix)
Definition ProSEAlgorithm.h:856
Size report_top_hits_
Definition ProSEAlgorithm.h:1452
Size modifications_max_variable_mods_per_peptide_
Definition ProSEAlgorithm.h:1420
static PercolatorRescoring rescoreWithPercolator(std::vector< ProteinIdentification > &protein_ids, PeptideIdentificationList &peptide_ids, int threads, Size max_train_psms=0)
Rescore the PSMs of one search run in-process with Percolator, as the parameter 'rescore' does in eve...
static void renderModificationSummary(const OpenSearchModificationAnalysis::OpenSearchAnalysisResult &mod_analysis, std::ostream &os)
std::string warning
Definition ProSEAlgorithm.h:172
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.
void setKeepPreFdrPsms(bool keep)
Definition ProSEAlgorithm.h:861
Precursor precursor
the co-isolated precursor: that of the spectrum with its m/z and charge
Definition ProSEAlgorithm.h:1193
void searchCoIsolated_(const PeakMap &spectra, const std::vector< std::vector< AnnotatedHit_ > > &annotated_hits, FragmentIndex &fi, const std::vector< FASTAFile::FASTAEntry > &db, const SpectrumGenerators_ &generators, double fragment_tol, bool fragment_tol_ppm, bool open_search_mode, std::vector< CoIsolatedPSM_ > &psms, std::vector< std::vector< AnnotatedHit_ > > &hits, std::vector< CandidatePoolStats_ > &pool_stats) const
Search the precursors co-isolated with the selected one in what the spectrum's other PSMs leave of it...
std::string input_file
spectrum file this run searched (basename or path)
Definition ProSEAlgorithm.h:92
SearchContext prepareContext_(std::vector< FASTAFile::FASTAEntry > &&fasta_db, bool electron_ions, const std::function< const PeakMap *(Size)> &searched_spectra={}) const
PeptideIdentificationList pre_fdr_peptide_ids
Definition ProSEAlgorithm.h:194
std::map< Int, Size > charge_histogram
precursor charge -> PSM count
Definition ProSEAlgorithm.h:103
SpectrumGenerators_ spectrumGenerators_() const
Generators for scoring, annotation and calibration, configured from the ions:* parameters.
StringList modifications_fixed_
Definition ProSEAlgorithm.h:1416
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).
std::string parameter_name_prefix_
Definition ProSEAlgorithm.h:1509
static void splitMergedPsms(MergedResult &merged, MultiFileSearchResult &result)
Makes the PSMs of each file of a multi-file search its part of the pooled result (mergeFileResults())...
static void capturePreFdrStats_(const PeptideIdentificationList &peptide_ids, RunStatistics &stats)
void annotateIonPriors_(const PeakMap &spectra, const FragmentIonLikelihoodModel::PeakLists &evidence, std::vector< ProteinIdentification > &protein_ids, PeptideIdentificationList &peptide_ids) const
Learn per-run fragment ion likelihoods from confident PSMs and annotate every hit with them.
void annotatePsmQValues(PeptideIdentificationList &peptide_ids) const
Annotate PSM q-values by target-decoy competition of the best hit of each spectrum,...
static bool hasPSMs_(const PeptideIdentificationList &ids)
Helper: whether a PSM of ids has a hit.
std::vector< UInt32 > removed
the peaks of the spectrum that its residual spectrum leaves out (ascending)
Definition ProSEAlgorithm.h:1194
static int searchedFileOf_(const PeptideIdentification &id, const std::vector< SearchResult > &per_file)
std::vector< ProteinIdentification > protein_ids
Definition ProSEAlgorithm.h:187
bool restrictIndexToSpectra_() const
Definition ProSEAlgorithm.h:1183
bool chimericSearch_() const
Definition ProSEAlgorithm.h:1187
Size peptide_min_size_
Definition ProSEAlgorithm.h:1446
SpectraCounts_ countSpectra_(const PeakMap &spectra) const
Helper: the SpectraCounts_ of spectra.
std::vector< FASTAFile::FASTAEntry > buildDecoyAugmentedDB_(const std::vector< FASTAFile::FASTAEntry > &fasta_db, const DecoyStrategy_ &strategy) const
Build the searched database according to strategy.
static bool applyCompleteSetProteinFDR(std::vector< ProteinIdentification > &protein_ids, PeptideIdentificationList &peptide_ids, const std::string &decoy_string, bool decoy_is_prefix, double protein_fdr, bool remove_decoys, const PeptideIdentificationList &inference_only_psms)
Finalize protein-level FDR on a COMPLETE protein set (a single input file, or a merged cross-file agg...
MergedResult mergeFileResults(MultiFileSearchResult &result, const StringList &in_spectra_files, bool remove_decoys=true) const
Pools result (moving its PSMs out), infers proteins across files, applies FDR:protein of this instanc...
SearchResult aggregate
Definition ProSEAlgorithm.h:247
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).
void annotatePeptDeepFeatures_(const PeakMap &spectra, std::vector< ProteinIdentification > &protein_ids, PeptideIdentificationList &peptide_ids) const
Adds PeptDeep-prediction-derived rescoring features to the PSMs.
std::string database_file
FASTA path (empty for in-memory db)
Definition ProSEAlgorithm.h:134
static AASequence reversedNoiseSequence_(const AASequence &sequence)
Reversed sequence keeping the C-terminal residue and every residue's modification: the noise hypothes...
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.
static StringList percolatorFeatureSet_(const ProteinIdentification &run, int min_charge, int max_charge)
std::vector< FASTAFile::FASTAEntry > buildDecoyAugmentedDB_(std::vector< FASTAFile::FASTAEntry > &&fasta_db, const DecoyStrategy_ &strategy) const
As above, but takes the entries of fasta_db over instead of copying them.
std::string strip_string
marker of pre-existing decoys to strip
Definition ProSEAlgorithm.h:1074
std::map< Size, Size > missed_cleavage_histogram
missed cleavages -> PSM count
Definition ProSEAlgorithm.h:104
static ProteinMapping_ buildProteinMapping_(const FragmentIndex &index, const std::vector< FASTAFile::FASTAEntry > &db, std::vector< UInt32 > candidates, const Param &indexer_parameters)
Collects the protein occurrences of the sequences of the index peptides candidates.
RunStatistics last_run_stats_
Definition ProSEAlgorithm.h:1503
std::string fragment_mass_tolerance_unit_
Definition ProSEAlgorithm.h:1393
static bool applyProteinMapping_(const ProteinMapping_ &mapping, const std::vector< FASTAFile::FASTAEntry > &db, const Param &indexer_parameters, std::vector< ProteinIdentification > &protein_ids, PeptideIdentificationList &peptide_ids, std::string &fallback_reason)
Writes what PeptideIndexing::run(db, protein_ids, peptide_ids) with indexer_parameters writes: the ev...
StringList annotate_psm_
Definition ProSEAlgorithm.h:1434
static void removeUnreportedProteins(std::vector< ProteinIdentification > &protein_ids, const PeptideIdentificationList &peptide_ids, const PeptideIdentificationList &also_referencing=PeptideIdentificationList())
Removes the proteins that no PSM references, and them from the protein groups.
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 bool rescoredOnItsOwn_(const SearchResult &pf)
Helper: whether the file of pf was searched and Percolator rescored it on its own (with 'rescore')
Param fragmentIndexParameters_(bool electron_ions=false) const
ProSE parameters made safe to hand to a FragmentIndex.
static PeakMap loadSpectra(const std::string &filename, const std::function< bool(const MSSpectrum &)> &keep={})
The MS2 spectra of a spectrum file as the searches of this class read them.
OpenSearchModificationAnalysis::OpenSearchAnalysisResult modification_analysis
Definition ProSEAlgorithm.h:189
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:283
static std::string renderTotalTime(const SharedSearchStats &sh)
The total time of a run, by part: "total <s>s | search of the file(s) <s>s | outputs <s>s (of ...
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:260
bool isOpenSearchMode_() const
Helper function to determine if open search should be used based on tolerance.
Definition ProSEAlgorithm.h:1876
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.
void limitPreRescoringPsms_(std::vector< SearchResult > &per_file, Size i, std::vector< TransferStratum_ > &strata) const
In a multi-file search with 'rescore' (pool_rescoring_), right after file i of per_file was searched ...
PeptideIdentificationList inference_only_peptide_ids
Definition ProSEAlgorithm.h:200
void collectInferenceOnlyPsms_(const PeptideIdentificationList &peptide_ids, double psm_fdr, PeptideIdentificationList &inference_only_psms) const
std::string decoy_string
Definition ProSEAlgorithm.h:252
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)
DeisotopingSettings_ deisotoping_
MS2 deisotoping rule (fragment:deisotope_*)
Definition ProSEAlgorithm.h:1413
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 void returnPooledPsms_(PeptideIdentificationList &pooled, std::vector< SearchResult > &per_file)
static bool isElectronActivated_(const MSSpectrum &spectrum)
True if the precursor of spectrum was activated by electrons (ETD, ECD, EThcD or ETciD)
bool keepPreRescoringPsms_() const
Whether a search keeps the PSMs of each file before the rescoring (SearchResult::pre_fdr_peptide_ids)
Definition ProSEAlgorithm.h:1518
std::string paramName_(const std::string &name) const
Helper: name as the user sets the parameter (setParameterNamePrefix()), for messages.
Definition ProSEAlgorithm.h:1511
std::string decoy_mode
"generated" | "external" | "none (target-only)"
Definition ProSEAlgorithm.h:147
PeptideIdentificationList peptide_ids
Definition ProSEAlgorithm.h:188
std::string enzyme
Definition ProSEAlgorithm.h:135
static LocalFragmentEvidence_ localFragmentEvidence_(const MSSpectrum &spectrum, const MSSpectrum &theoretical, int max_charge, const std::vector< double > &densities, double tolerance, bool ppm, std::vector< double > &alternatives)
std::string skipped_reason
Why the PSMs were not rescored, as a sentence to show to the user (empty if applied or not attempted)
Definition ProSEAlgorithm.h:169
void updateMembers_() override
This method is used to update extra member variables at the end of the setParameters() method.
static Param percolatorParameters_(int threads, Size max_train_psms)
Helper: the Percolator parameters of rescoreWithPercolator() (training cap max_train_psms,...
static void tdcQValues_(PeptideIdentificationList &peptide_ids, bool plus_one=false)
ExitCodes
Exit codes.
Definition ProSEAlgorithm.h:73
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 std::vector< Size > *evidence_parent=nullptr) const
Filter and annotate search results.
StringList modifications_variable_
Definition ProSEAlgorithm.h:1418
static double maxRetainedScore_(const PeptideIdentificationList &peptide_ids)
PeptideIdentificationList pre_fdr_peptide_ids_
Definition ProSEAlgorithm.h:1521
std::vector< SearchResult > per_file
Definition ProSEAlgorithm.h:246
double fragment_mass_tolerance_
Definition ProSEAlgorithm.h:1391
PeptideIdentificationList inference_only_peptide_ids_
Definition ProSEAlgorithm.h:1524
SearchContext prepareContext(const std::vector< FASTAFile::FASTAEntry > &fasta_db) const
Build a SearchContext (decoy-augmented database + FragmentIndex) for reuse.
static Size removeDuplicateProteins(std::vector< FASTAFile::FASTAEntry > &db, const std::string &source)
Removes the repeated entries of a protein database, which searching would report twice (e....
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:1406
static void removeProteinsReferencedByNeither_(std::vector< ProteinIdentification > &protein_ids, const PeptideIdentificationList &peptide_ids, const PeptideIdentificationList &also_referencing)
std::vector< Size > draw
Definition ProSEAlgorithm.h:1752
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:1448
CalibrationResult_ last_calibration_result_
Definition ProSEAlgorithm.h:1496
double computeModMatchTolerance_() const
Definition ProSEAlgorithm.h:1545
static void poolSearchedFiles_(std::vector< SearchResult > &per_file, bool move_psms, const StringList &in_spectra_files, std::vector< ProteinIdentification > &protein_ids, PeptideIdentificationList &peptide_ids)
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:142
static bool useSearchEngineScore_(PeptideIdentificationList &ids)
std::string peptdeep_ms2_model_
Definition ProSEAlgorithm.h:1374
static bool searched_(const SearchResult &pf)
Helper: whether the file of pf was searched (exit code EXECUTION_OK, with a run)
std::string precursor_tol_unit
Definition ProSEAlgorithm.h:137
DecoyMode_
How decoys are obtained/recognised for a search (parameter "decoys").
Definition ProSEAlgorithm.h:1054
static void markRescoredByPercolator_(std::vector< ProteinIdentification > &protein_ids, const Param &pp)
Helper: marks protein_ids as post-processed by Percolator (with parameters pp), as PercolatorAdapter ...
std::string peptdeep_rt_model_
Definition ProSEAlgorithm.h:1375
void preprocessSearchedSpectra_(PeakMap &spectra, const std::string &input, FragmentIonLikelihoodModel::PeakLists &ion_evidence, PeakMap *evidence_spectra, PeakMap *query_spectra) const
Result of a calibration pass.
Definition ProSEAlgorithm.h:1482
The PSM of a precursor co-isolated with the selected one (chimeric:enabled), until its residual spect...
Definition ProSEAlgorithm.h:1191
Resolved decoy handling for one concrete input database.
Definition ProSEAlgorithm.h:1068
MS2 deisotoping rule of preprocessSpectra_().
Definition ProSEAlgorithm.h:973
Local fragment evidence of one candidate (annotate:local_fragment_evidence).
Definition ProSEAlgorithm.h:1112
The pooled evaluation of a multi-file search (the ProSE tool's -out_merged).
Definition ProSEAlgorithm.h:265
Multi-file search result bundle.
Definition ProSEAlgorithm.h:245
Outcome of the Percolator rescoring of one search run (see rescoreWithPercolator() and the parameter ...
Definition ProSEAlgorithm.h:165
Per-run identification statistics for the end-of-search report.
Definition ProSEAlgorithm.h:91
Prepared per-database state shared across multiple spectrum files.
Definition ProSEAlgorithm.h:282
Comprehensive search result including modification analysis.
Definition ProSEAlgorithm.h:185
Configuration, database and fragment-index facts shared across all input files of one ProSE invocatio...
Definition ProSEAlgorithm.h:133
Definition ProSEAlgorithm.h:1806
Definition ProSEAlgorithm.h:1745
Base class for all classes that want to report their progress.
Definition ProgressLogger.h:27
Representation of a protein identification run.
Definition ProteinIdentification.h:55
int Int
Signed integer type.
Definition Types.h:72
uint32_t UInt32
Unsigned integer type (32bit)
Definition Types.h:33
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition Types.h:97
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:872
static bool hasBetterScore(const AnnotatedHit_ &a, const AnnotatedHit_ &b)
Definition ProSEAlgorithm.h:890
double score
main score
Definition ProSEAlgorithm.h:879
AASequence sequence
Definition ProSEAlgorithm.h:873
Running summary of the complete candidate pool of one spectrum.
Definition ProSEAlgorithm.h:917
std::unordered_set< std::string > seen_candidates
Definition ProSEAlgorithm.h:925
void add(double score)
Fold one freshly scored candidate into the summary.
Definition ProSEAlgorithm.h:928
double deltaScore() const
Best minus runner-up over the full pool.
Definition ProSEAlgorithm.h:938
double zScore() const
How much of an outlier the best score is within its own candidate pool.
The protein occurrences of the sequences of a search's hits (peptide:protein_mapping = index).
Definition ProSEAlgorithm.h:1588
std::vector< std::string_view > sequences
The unmodified hit sequences (views into the database), one entry each.
Definition ProSEAlgorithm.h:1592
std::string fallback_reason
Why PeptideIndexing has to run instead; empty if the mapping applies.
Definition ProSEAlgorithm.h:1598
Size find(std::string_view sequence) const
The entry of sequence, or sequences.size() if there is none.
Definition ProSEAlgorithm.h:1601
std::vector< std::vector< std::pair< UInt32, UInt32 > > > occurrences
Per entry: its occurrences {protein index, position}, ascending (PeptideIndexing's evidence order)
Definition ProSEAlgorithm.h:1594
std::vector< std::unordered_map< std::string_view, Size > > entries
Sequence -> entry, in SHARDS hash tables.
Definition ProSEAlgorithm.h:1596