29#include <unordered_map>
30#include <unordered_set>
37class TheoreticalSpectrumGenerator;
62 static constexpr const char* CHIMERIC_RANK =
"chimeric_rank";
88 Size charge_out_of_range_spectra = 0;
92 bool fdr_applied =
false;
93 double achieved_psm_fdr = -1.0;
98 bool score_stats_valid =
false;
99 double hyperscore_min = 0.0;
100 double hyperscore_median = 0.0;
101 double hyperscore_max = 0.0;
106 bool prec_tol_valid =
false;
107 double prec_err_median = 0.0, prec_err_mad = 0.0, prec_err_recommended = 0.0;
110 bool frag_tol_valid =
false;
111 double frag_err_median = 0.0, frag_err_mad = 0.0, frag_err_recommended = 0.0;
112 double seconds_search = 0.0;
113 double seconds_calibration = 0.0;
114 double seconds_fdr = 0.0;
129 double precursor_tol_lower = 0.0, precursor_tol_upper = 0.0;
131 double fragment_tol = 0.0;
133 Int min_charge = 0, max_charge = 0;
135 std::vector<std::string>
fixed_mods, variable_mods, ion_series;
136 bool open_search =
false;
137 bool calibration_enabled =
false;
138 bool peptide_mass_mode =
false;
139 bool chunked =
false;
141 double psm_fdr_threshold = 0.0, protein_fdr_threshold = 0.0;
146 double seconds_index_build = 0.0;
147 double seconds_total = 0.0;
148 double seconds_output = 0.0;
149 double seconds_qpx_extended = 0.0;
160 bool applied =
false;
183 bool is_open_search =
false;
244 bool decoy_is_prefix =
true;
246 bool have_decoys =
false;
260 bool protein_fdr_applied =
false;
273 std::vector<FASTAFile::FASTAEntry>
db;
285 bool release_fragment_index_after_scoring =
false;
293 bool decoy_is_prefix =
true;
296 bool have_decoys =
false;
301 bool electron_ions =
false;
326 const std::string& in_db,
327 std::vector<ProteinIdentification>& prot_ids,
377 const std::string& decoy_string,
378 bool decoy_is_prefix,
400 static std::string
inferProteins(std::vector<ProteinIdentification>& protein_ids,
549 const std::string& in_db,
550 const std::string& output_base_name =
"")
const;
570 const std::vector<FASTAFile::FASTAEntry>& fasta_db,
571 std::vector<ProteinIdentification>& prot_ids,
633 std::vector<ProteinIdentification>& prot_ids,
647 const std::vector<FASTAFile::FASTAEntry>& fasta_db,
648 const std::string& output_base_name =
"")
const;
701 const std::vector<std::string>& in_spectra_files,
702 const std::vector<FASTAFile::FASTAEntry>& fasta_db,
703 const std::vector<std::string>& output_base_names = {},
704 const std::string& aggregate_base_name =
"",
705 bool build_pooled_aggregate =
true)
const;
721 const std::vector<std::string>& in_spectra_files,
722 const std::string& in_db,
723 const std::vector<std::string>& output_base_names = {},
724 const std::string& aggregate_base_name =
"",
725 bool build_pooled_aggregate =
true)
const;
772 bool remove_decoys =
true)
const;
779 keep_pre_fdr_psms_ = keep;
796 double delta_mass = 0.0;
797 float prefix_fraction = 0;
798 float suffix_fraction = 0;
799 float mean_error = 0.0f;
800 int isotope_error = 0;
801 uint16_t applied_charge = 0;
802 uint16_t matched_prefix_ions = 0;
803 uint16_t matched_suffix_ions = 0;
837 double second_best = 0.0;
846 if (score > best) { second_best = best; best = score; }
847 else if (score > second_best) { second_best = score; }
849 sumsq += score * score;
890 unsigned int min_peaks{3};
891 bool charge_cap_precursor{
false};
892 bool sum_intensity{
false};
910 double fragment_mass_tolerance,
911 bool fragment_mass_tolerance_unit_ppm,
912 bool deisotope_requested,
914 Int peaks_window_top,
915 const std::string& window_type,
918 bool ion_evidence_scored_peaks =
false,
919 PeakMap* evidence_spectra =
nullptr,
920 PeakMap* query_spectra =
nullptr);
924 double fragment_mass_tolerance,
925 bool fragment_mass_tolerance_unit_ppm,
926 bool deisotope_requested,
928 Int peaks_window_top,
929 const std::string& window_type =
"auto");
959 std::vector<ProteinIdentification>& protein_ids,
985 bool generate{
false};
986 bool strip_existing{
false};
987 bool have_decoys{
false};
989 bool is_prefix{
true};
991 bool strip_is_prefix{
true};
1003 const std::vector<FASTAFile::FASTAEntry>& db)
const;
1021 struct SpectrumGenerators_;
1029 double chance_match_surprise = 0.0;
1030 double mass_competition_evidence = 0.0;
1056 const std::vector<double>& densities,
1057 double tolerance,
bool ppm);
1064 const std::vector<double>& densities,
1065 double tolerance,
bool ppm,
1066 std::vector<double>& alternatives);
1082 const std::vector<FASTAFile::FASTAEntry>& fasta_db,
1087 std::vector<FASTAFile::FASTAEntry>&& fasta_db,
1094 const std::function<
const PeakMap*(
Size)>& searched_spectra = {})
const;
1138 const std::vector<std::vector<AnnotatedHit_>>& annotated_hits,
1140 const std::vector<FASTAFile::FASTAEntry>& db,
1141 const SpectrumGenerators_& generators,
1142 double fragment_tol,
1143 bool fragment_tol_ppm,
1144 bool open_search_mode,
1145 std::vector<CoIsolatedPSM_>& psms,
1146 std::vector<std::vector<AnnotatedHit_>>& hits,
1147 std::vector<CandidatePoolStats_>& pool_stats)
const;
1167 const std::vector<FASTAFile::FASTAEntry>& full_db)
const;
1184 std::vector<FASTAFile::FASTAEntry>& full_db,
1186 std::vector<ProteinIdentification>& protein_ids,
1216 const std::vector<FASTAFile::FASTAEntry>& db,
1217 const SpectrumGenerators_& generators,
1218 double effective_fragment_tol,
1219 bool fragment_mass_tolerance_unit_ppm,
1220 bool open_search_mode,
1221 std::vector<std::vector<AnnotatedHit_>>& annotated_hits,
1222 std::vector<CandidatePoolStats_>& pool_stats,
1223 const std::string& progress_label,
1224 const PeakMap* query_spectra =
nullptr)
const;
1259 std::vector<std::vector<ProSEAlgorithm::AnnotatedHit_> >& annotated_hits,
1260 const std::vector<CandidatePoolStats_>& pool_stats,
1261 std::vector<ProteinIdentification>& protein_ids,
1266 Int peptide_missed_cleavages,
1267 double precursor_mass_tolerance,
1268 double fragment_mass_tolerance,
1269 const std::string& precursor_mass_tolerance_unit_ppm,
1270 const std::string& fragment_mass_tolerance_unit_ppm,
1271 const Int precursor_min_charge,
1272 const Int precursor_max_charge,
1273 const std::string& enzyme,
1274 const std::string& database_name,
1275 const PeakMap* evidence_spectra =
nullptr,
1276 const std::vector<Size>* evidence_parent =
nullptr)
const;
1286 std::vector<ProteinIdentification>& protein_ids,
1289 bool peptdeep_enable_{
false};
1292 std::string peptdeep_instrument_{
"QE"};
1293 double peptdeep_nce_{-1.0};
1294 std::string peptdeep_rt_model_type_{
"b_spline"};
1295 int peptdeep_batch_size_{500};
1300 mutable double precursor_mass_tolerance_lower_{10.0};
1301 mutable double precursor_mass_tolerance_upper_{10.0};
1302 std::string precursor_mass_tolerance_unit_{
"ppm"};
1315 bool deisotope_requested_{
true};
1316 bool scoring_multiple_charges_{
false};
1317 int scoring_max_charge_{2};
1318 bool mass_accuracy_score_{
false};
1319 double mass_error_sd_ppm_{7.0};
1324 return scoring_multiple_charges_ ? std::max(1, std::min(precursor_charge - 1, scoring_max_charge_)) : 1;
1328 std::string peaks_window_type_ {
"auto"};
1330 bool query_raw_spectrum_{
false};
1343 bool rescore_{
true};
1344 double fdr_psm_{0.0};
1345 bool fdr_psm_by_scored_charges_{
true};
1346 double fdr_protein_{0.0};
1347 double fdr_protein_inference_psm_{0.1};
1351 bool self_trained_ion_priors_{
false};
1353 bool ion_prior_scored_peaks_{
false};
1354 int ion_prior_max_fragment_charge_{2};
1355 double ion_prior_train_fdr_{0.01};
1357 bool ion_prior_feature_llr_{
true};
1358 bool ion_prior_feature_explained_{
true};
1359 bool ion_prior_feature_topk_{
false};
1370 bool isotope_error_observed_minus_theoretical_{
true};
1372 bool add_a_ions_{
false};
1373 bool add_b_ions_{
true};
1374 bool add_c_ions_{
false};
1375 bool add_x_ions_{
false};
1376 bool add_y_ions_{
true};
1377 bool add_z_ions_{
false};
1378 bool add_zp1_ions_{
false};
1379 bool ions_by_activation_{
true};
1380 bool protein_mapping_from_index_{
true};
1384 bool calibration_enabled_{
false};
1385 double calibration_subset_ratio_{0.1};
1386 bool chimeric_enabled_{
false};
1398 double precursor_shift{0};
1399 double precursor_spread{0};
1400 double cal_lower{0};
1401 double cal_upper{0};
1402 double fragment_tolerance{0};
1403 double fragment_shift{0};
1404 bool extreme_bias{
false};
1405 bool success{
false};
1423 bool keep_pre_fdr_psms_ =
false;
1438 mutable double last_mod_match_tolerance_used_{-1.0};
1452 if (precursor_mass_tolerance_lower_ <= 0.0)
return precursor_mass_tolerance_upper_;
1453 if (precursor_mass_tolerance_upper_ <= 0.0)
return precursor_mass_tolerance_lower_;
1454 return std::min(precursor_mass_tolerance_lower_, precursor_mass_tolerance_upper_);
1472 const std::vector<FASTAFile::FASTAEntry>& db,
1473 const PeakMap* query_spectra =
nullptr)
const;
1501 std::vector<std::unordered_map<std::string_view, Size>>
entries;
1508 if (entries.empty())
return sequences.size();
1509 const auto& table = entries[std::hash<std::string_view>{}(sequence) % SHARDS];
1510 const auto entry = table.find(sequence);
1511 return entry == table.end() ? sequences.size() : entry->second;
1525 const std::vector<FASTAFile::FASTAEntry>& db,
1526 std::vector<UInt32> candidates,
1527 const Param& indexer_parameters);
1538 const std::vector<FASTAFile::FASTAEntry>& db,
1539 const Param& indexer_parameters,
1540 std::vector<ProteinIdentification>& protein_ids,
1542 std::string& fallback_reason);
1547 const std::string& marker,
bool is_prefix);
1599 const std::vector<ProteinIdentification>& protein_ids,
1635 const std::string& enzyme,
1653 bool is_open_search,
1669 const std::vector<std::pair<std::string, std::vector<std::string>>>& manifest,
1678 return FragmentIndex::isOpenSearchMode(precursor_mass_tolerance_lower_,
1679 precursor_mass_tolerance_upper_,
1680 precursor_mass_tolerance_unit_ ==
"ppm");
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
Precursor meta information.
Definition Precursor.h:37
Fragment-index-based peptide database search algorithm (experimental).
Definition ProSEAlgorithm.h:56
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:1338
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:1422
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:274
std::string fragment_tol_unit
Definition ProSEAlgorithm.h:132
Size peptide_max_size_
Definition ProSEAlgorithm.h:1362
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:186
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.
Size precursor_max_charge_
Definition ProSEAlgorithm.h:1305
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 that a search with Percolator rescoring deferred.
Size precursor_min_charge_
Definition ProSEAlgorithm.h:1304
std::string decoy_prefix_
Definition ProSEAlgorithm.h:1341
RunStatistics stats
Definition ProSEAlgorithm.h:184
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
Size report_top_hits_
Definition ProSEAlgorithm.h:1367
Size modifications_max_variable_mods_per_peptide_
Definition ProSEAlgorithm.h:1336
static void renderModificationSummary(const OpenSearchModificationAnalysis::OpenSearchAnalysisResult &mod_analysis, std::ostream &os)
std::string warning
Definition ProSEAlgorithm.h:165
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:777
Precursor precursor
the co-isolated precursor: that of the spectrum with its m/z and charge
Definition ProSEAlgorithm.h:1109
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:85
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:187
std::map< Int, Size > charge_histogram
precursor charge -> PSM count
Definition ProSEAlgorithm.h:96
SpectrumGenerators_ spectrumGenerators_() const
Generators for scoring, annotation and calibration, configured from the ions:* parameters.
StringList modifications_fixed_
Definition ProSEAlgorithm.h:1332
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)
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,...
std::vector< UInt32 > removed
the peaks of the spectrum that its residual spectrum leaves out (ascending)
Definition ProSEAlgorithm.h:1110
std::vector< ProteinIdentification > protein_ids
Definition ProSEAlgorithm.h:180
bool restrictIndexToSpectra_() const
Definition ProSEAlgorithm.h:1099
bool chimericSearch_() const
Definition ProSEAlgorithm.h:1103
Size peptide_min_size_
Definition ProSEAlgorithm.h:1361
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:237
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.
static PercolatorRescoring rescoreWithPercolator(std::vector< ProteinIdentification > &protein_ids, PeptideIdentificationList &peptide_ids, int threads)
Rescore the PSMs of one search run in-process with Percolator, as the parameter 'rescore' does in eve...
std::string database_file
FASTA path (empty for in-memory db)
Definition ProSEAlgorithm.h:127
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.
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:990
std::map< Size, Size > missed_cleavage_histogram
missed cleavages -> PSM count
Definition ProSEAlgorithm.h:97
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:1418
std::string fragment_mass_tolerance_unit_
Definition ProSEAlgorithm.h:1309
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:1349
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.
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:182
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:273
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:250
bool isOpenSearchMode_() const
Helper function to determine if open search should be used based on tolerance.
Definition ProSEAlgorithm.h:1676
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.
PeptideIdentificationList inference_only_peptide_ids
Definition ProSEAlgorithm.h:193
void collectInferenceOnlyPsms_(const PeptideIdentificationList &peptide_ids, double psm_fdr, PeptideIdentificationList &inference_only_psms) const
std::string decoy_string
Definition ProSEAlgorithm.h:242
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:1329
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:140
PeptideIdentificationList peptide_ids
Definition ProSEAlgorithm.h:181
std::string enzyme
Definition ProSEAlgorithm.h:128
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:162
void updateMembers_() override
This method is used to update extra member variables at the end of the setParameters() method.
ExitCodes
Exit codes.
Definition ProSEAlgorithm.h:66
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:1334
static double maxRetainedScore_(const PeptideIdentificationList &peptide_ids)
PeptideIdentificationList pre_fdr_peptide_ids_
Definition ProSEAlgorithm.h:1426
std::vector< SearchResult > per_file
Definition ProSEAlgorithm.h:236
double fragment_mass_tolerance_
Definition ProSEAlgorithm.h:1307
PeptideIdentificationList inference_only_peptide_ids_
Definition ProSEAlgorithm.h:1429
SearchContext prepareContext(const std::vector< FASTAFile::FASTAEntry > &fasta_db) const
Build a SearchContext (decoy-augmented database + FragmentIndex) for reuse.
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:1322
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:1363
CalibrationResult_ last_calibration_result_
Definition ProSEAlgorithm.h:1411
double computeModMatchTolerance_() const
Definition ProSEAlgorithm.h:1450
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:135
std::string peptdeep_ms2_model_
Definition ProSEAlgorithm.h:1290
std::string precursor_tol_unit
Definition ProSEAlgorithm.h:130
DecoyMode_
How decoys are obtained/recognised for a search (parameter "decoys").
Definition ProSEAlgorithm.h:970
std::string peptdeep_rt_model_
Definition ProSEAlgorithm.h:1291
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:1397
The PSM of a precursor co-isolated with the selected one (chimeric:enabled), until its residual spect...
Definition ProSEAlgorithm.h:1107
Resolved decoy handling for one concrete input database.
Definition ProSEAlgorithm.h:984
MS2 deisotoping rule of preprocessSpectra_().
Definition ProSEAlgorithm.h:889
Local fragment evidence of one candidate (annotate:local_fragment_evidence).
Definition ProSEAlgorithm.h:1028
The pooled evaluation of a multi-file search (the ProSE tool's -out_merged).
Definition ProSEAlgorithm.h:255
Multi-file search result bundle.
Definition ProSEAlgorithm.h:235
Outcome of the Percolator rescoring of one search run (see rescoreWithPercolator() and the parameter ...
Definition ProSEAlgorithm.h:158
Per-run identification statistics for the end-of-search report.
Definition ProSEAlgorithm.h:84
Prepared per-database state shared across multiple spectrum files.
Definition ProSEAlgorithm.h:272
Comprehensive search result including modification analysis.
Definition ProSEAlgorithm.h:178
Configuration, database and fragment-index facts shared across all input files of one ProSE invocatio...
Definition ProSEAlgorithm.h:126
Definition ProSEAlgorithm.h:1606
Base class for all classes that want to report their progress.
Definition ProgressLogger.h:27
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:788
static bool hasBetterScore(const AnnotatedHit_ &a, const AnnotatedHit_ &b)
Definition ProSEAlgorithm.h:806
double score
main score
Definition ProSEAlgorithm.h:795
AASequence sequence
Definition ProSEAlgorithm.h:789
Running summary of the complete candidate pool of one spectrum.
Definition ProSEAlgorithm.h:833
std::unordered_set< std::string > seen_candidates
Definition ProSEAlgorithm.h:841
void add(double score)
Fold one freshly scored candidate into the summary.
Definition ProSEAlgorithm.h:844
double deltaScore() const
Best minus runner-up over the full pool.
Definition ProSEAlgorithm.h:854
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:1493
std::vector< std::string_view > sequences
The unmodified hit sequences (views into the database), one entry each.
Definition ProSEAlgorithm.h:1497
std::string fallback_reason
Why PeptideIndexing has to run instead; empty if the mapping applies.
Definition ProSEAlgorithm.h:1503
Size find(std::string_view sequence) const
The entry of sequence, or sequences.size() if there is none.
Definition ProSEAlgorithm.h:1506
std::vector< std::vector< std::pair< UInt32, UInt32 > > > occurrences
Per entry: its occurrences {protein index, position}, ascending (PeptideIndexing's evidence order)
Definition ProSEAlgorithm.h:1499
std::vector< std::unordered_map< std::string_view, Size > > entries
Sequence -> entry, in SHARDS hash tables.
Definition ProSEAlgorithm.h:1501