OpenMS
PercolatorFeatureSetHelper.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: 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>
25 
26 namespace OpenMS
27 {
38  class OPENMS_DLLAPI PercolatorFeatureSetHelper
39  {
40 
41  public:
50  static void concatMULTISEPeptideIds(PeptideIdentificationList& all_peptide_ids, PeptideIdentificationList& new_peptide_ids, const String& search_engine);
51 
60  static void mergeMULTISEPeptideIds(PeptideIdentificationList& all_peptide_ids, PeptideIdentificationList& new_peptide_ids, const String& search_engine);
61 
69  static void mergeMULTISEProteinIds(std::vector<ProteinIdentification>& all_protein_ids, std::vector<ProteinIdentification>& new_protein_ids);
70 
71 
79  static void addMSGFFeatures(PeptideIdentificationList& peptide_ids, StringList& feature_set);
80 
88  static void addXTANDEMFeatures(PeptideIdentificationList& peptide_ids, StringList& feature_set);
89 
97  static void addCOMETFeatures(PeptideIdentificationList& peptide_ids, StringList& feature_set);
98 
106  static void addMASCOTFeatures(PeptideIdentificationList& peptide_ids, StringList& feature_set);
107 
118  static void addMULTISEFeatures(PeptideIdentificationList& peptide_ids, StringList& search_engines_used, StringList& feature_set, bool complete_only = true, bool limits_imputation = false);
119 
128  static void addCONCATSEFeatures(PeptideIdentificationList& peptide_id_list, StringList& search_engines_used, StringList& feature_set);
129 
137  static void checkExtraFeatures(const std::vector<PeptideHit> &psms, StringList& extra_features);
138 
145  static void addMSFRAGGERFeatures(StringList& extra_features);
146 
147 
148  protected:
150  static double rescaleFragmentFeature_(double featureValue, int NumMatchedMainIons);
151 
153  static void assignDeltaScore_(std::vector<PeptideHit>& hits, const String& score_ref, const String& output_ref);
154 
157 
160  {
161  inline bool operator() (const ProteinHit& h1, const ProteinHit& h2)
162  {
163  return (h1.getAccession() < h2.getAccession());
164  }
165  };
166 
169  {
170  inline bool operator() (const PeptideEvidence& h1, const PeptideEvidence& h2)
171  {
172  return (h1.getProteinAccession() < h2.getProteinAccession());
173  }
174  };
175 
176  };
177 
178 } //namespace OpenMS
179 
180 
typename VecMember::iterator iterator
Definition: ExposedVector.h:68
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.
Container for peptide identifications from multiple spectra.
Definition: PeptideIdentificationList.h:66
Percolator feature set and integration helper.
Definition: PercolatorFeatureSetHelper.h:39
static void addMSFRAGGERFeatures(StringList &extra_features)
addMSFraggerFeatures
static void addMASCOTFeatures(PeptideIdentificationList &peptide_ids, StringList &feature_set)
addMASCOTFeatures
static void addXTANDEMFeatures(PeptideIdentificationList &peptide_ids, StringList &feature_set)
addXTANDEMFeatures
static void addMSGFFeatures(PeptideIdentificationList &peptide_ids, StringList &feature_set)
addMSGFFeatures
static void addCOMETFeatures(PeptideIdentificationList &peptide_ids, StringList &feature_set)
addCOMETFeatures
static void concatMULTISEPeptideIds(PeptideIdentificationList &all_peptide_ids, PeptideIdentificationList &new_peptide_ids, const String &search_engine)
concatMULTISEPeptideIds
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 addMULTISEFeatures(PeptideIdentificationList &peptide_ids, StringList &search_engines_used, StringList &feature_set, bool complete_only=true, bool limits_imputation=false)
addMULTISEFeatures
static void addCONCATSEFeatures(PeptideIdentificationList &peptide_id_list, StringList &search_engines_used, StringList &feature_set)
addCONCATSEFeatures
static double rescaleFragmentFeature_(double featureValue, int NumMatchedMainIons)
Rescales the fragment features to penalize features calculated by few ions, adapted from MSGFtoPercol...
static String getScanMergeKey_(PeptideIdentificationList::iterator it, PeptideIdentificationList::iterator start)
gets the scan identifier to merge by
static void mergeMULTISEPeptideIds(PeptideIdentificationList &all_peptide_ids, PeptideIdentificationList &new_peptide_ids, const String &search_engine)
mergeMULTISEPeptideIds
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: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
For accession dependent sorting of PeptideEvidences.
Definition: PercolatorFeatureSetHelper.h:169
For accession dependent sorting of ProteinHits.
Definition: PercolatorFeatureSetHelper.h:160