OpenMS
PercolatorFeatureSetHelper.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Mathias Walzer $
6 // $Authors: Mathias Walzer, Matthew The $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 #include <vector>
12 #include <cmath>
13 #include <string>
14 #include <map>
15 // #include <algorithm>
16 #include <limits>
17 
18 #include <OpenMS/CONCEPT/Types.h>
24 
25 namespace OpenMS
26 {
37  class OPENMS_DLLAPI PercolatorFeatureSetHelper
38  {
39 
40  public:
49  static void concatMULTISEPeptideIds(std::vector<PeptideIdentification>& all_peptide_ids, std::vector<PeptideIdentification>& new_peptide_ids, const String& search_engine);
50 
59  static void mergeMULTISEPeptideIds(std::vector<PeptideIdentification>& all_peptide_ids, std::vector<PeptideIdentification>& new_peptide_ids, const String& search_engine);
60 
68  static void mergeMULTISEProteinIds(std::vector<ProteinIdentification>& all_protein_ids, std::vector<ProteinIdentification>& new_protein_ids);
69 
70 
78  static void addMSGFFeatures(std::vector<PeptideIdentification>& peptide_ids, StringList& feature_set);
79 
87  static void addXTANDEMFeatures(std::vector<PeptideIdentification>& peptide_ids, StringList& feature_set);
88 
96  static void addCOMETFeatures(std::vector<PeptideIdentification>& peptide_ids, StringList& feature_set);
97 
105  static void addMASCOTFeatures(std::vector<PeptideIdentification>& peptide_ids, StringList& feature_set);
106 
117  static void addMULTISEFeatures(std::vector<PeptideIdentification>& peptide_ids, StringList& search_engines_used, StringList& feature_set, bool complete_only = true, bool limits_imputation = false);
118 
127  static void addCONCATSEFeatures(std::vector<PeptideIdentification>& peptide_id_list, StringList& search_engines_used, StringList& feature_set);
128 
136  static void checkExtraFeatures(const std::vector<PeptideHit> &psms, StringList& extra_features);
137 
144  static void addMSFRAGGERFeatures(StringList& extra_features);
145 
146 
147  protected:
149  static double rescaleFragmentFeature_(double featureValue, int NumMatchedMainIons);
150 
152  static void assignDeltaScore_(std::vector<PeptideHit>& hits, const String& score_ref, const String& output_ref);
153 
155  static String getScanMergeKey_(std::vector<PeptideIdentification>::iterator it, std::vector<PeptideIdentification>::iterator start);
156 
159  {
160  inline bool operator() (const ProteinHit& h1, const ProteinHit& h2)
161  {
162  return (h1.getAccession() < h2.getAccession());
163  }
164  };
165 
168  {
169  inline bool operator() (const PeptideEvidence& h1, const PeptideEvidence& h2)
170  {
171  return (h1.getProteinAccession() < h2.getProteinAccession());
172  }
173  };
174 
175  };
176 
177 } //namespace OpenMS
178 
179 
Representation of a peptide evidence.
Definition: PeptideEvidence.h:25
const String & getProteinAccession() const
get the protein accession the peptide matches to. If not available the empty string is returned.
Percolator feature set and integration helper.
Definition: PercolatorFeatureSetHelper.h:38
static void addMSFRAGGERFeatures(StringList &extra_features)
addMSFraggerFeatures
static void addMSGFFeatures(std::vector< PeptideIdentification > &peptide_ids, StringList &feature_set)
addMSGFFeatures
static void addCONCATSEFeatures(std::vector< PeptideIdentification > &peptide_id_list, StringList &search_engines_used, StringList &feature_set)
addCONCATSEFeatures
static void addCOMETFeatures(std::vector< PeptideIdentification > &peptide_ids, StringList &feature_set)
addCOMETFeatures
static void addXTANDEMFeatures(std::vector< PeptideIdentification > &peptide_ids, StringList &feature_set)
addXTANDEMFeatures
static String getScanMergeKey_(std::vector< PeptideIdentification >::iterator it, std::vector< PeptideIdentification >::iterator start)
gets the scan identifier to merge by
static void concatMULTISEPeptideIds(std::vector< PeptideIdentification > &all_peptide_ids, std::vector< PeptideIdentification > &new_peptide_ids, const String &search_engine)
concatMULTISEPeptideIds
static void addMULTISEFeatures(std::vector< PeptideIdentification > &peptide_ids, StringList &search_engines_used, StringList &feature_set, bool complete_only=true, bool limits_imputation=false)
addMULTISEFeatures
static void checkExtraFeatures(const std::vector< PeptideHit > &psms, StringList &extra_features)
checkExtraFeatures
static void mergeMULTISEProteinIds(std::vector< ProteinIdentification > &all_protein_ids, std::vector< ProteinIdentification > &new_protein_ids)
mergeMULTISEProteinIds
static void addMASCOTFeatures(std::vector< PeptideIdentification > &peptide_ids, StringList &feature_set)
addMASCOTFeatures
static void mergeMULTISEPeptideIds(std::vector< PeptideIdentification > &all_peptide_ids, std::vector< PeptideIdentification > &new_peptide_ids, const String &search_engine)
mergeMULTISEPeptideIds
static double rescaleFragmentFeature_(double featureValue, int NumMatchedMainIons)
Rescales the fragment features to penalize features calculated by few ions, adapted from MSGFtoPercol...
static void assignDeltaScore_(std::vector< PeptideHit > &hits, const String &score_ref, const String &output_ref)
helper function for assigning the frequently occurring feature delta score
Representation of a protein hit.
Definition: ProteinHit.h:34
const String & getAccession() const
returns the accession of the protein
A more convenient string class.
Definition: String.h:34
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:44
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22
For accession dependent sorting of PeptideEvidences.
Definition: PercolatorFeatureSetHelper.h:168
For accession dependent sorting of ProteinHits.
Definition: PercolatorFeatureSetHelper.h:159