OpenMS  2.4.0
PercolatorFeatureSetHelper.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2018.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Mathias Walzer $
32 // $Authors: Mathias Walzer, Matthew The $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
37 #include <vector>
38 #include <iostream>
39 #include <cmath>
40 #include <string>
41 #include <map>
42 #include <algorithm>
43 #include <limits>
44 
45 #include <OpenMS/CONCEPT/Types.h>
52 
53 #include <boost/lexical_cast.hpp>
54 
55 namespace OpenMS
56 {
67  class OPENMS_DLLAPI PercolatorFeatureSetHelper
68  {
69 
70  public:
79  static void concatMULTISEPeptideIds(std::vector<PeptideIdentification>& all_peptide_ids, std::vector<PeptideIdentification>& new_peptide_ids, String search_engine);
80 
89  static void mergeMULTISEPeptideIds(std::vector<PeptideIdentification>& all_peptide_ids, std::vector<PeptideIdentification>& new_peptide_ids, String search_engine);
90 
98  static void mergeMULTISEProteinIds(std::vector<ProteinIdentification>& all_protein_ids, std::vector<ProteinIdentification>& new_protein_ids);
99 
100 
108  static void addMSGFFeatures(std::vector<PeptideIdentification>& peptide_ids, StringList& feature_set);
109 
117  static void addXTANDEMFeatures(std::vector<PeptideIdentification>& peptide_ids, StringList& feature_set);
118 
126  static void addCOMETFeatures(std::vector<PeptideIdentification>& peptide_ids, StringList& feature_set);
127 
135  static void addMASCOTFeatures(std::vector<PeptideIdentification>& peptide_ids, StringList& feature_set);
136 
147  static void addMULTISEFeatures(std::vector<PeptideIdentification>& peptide_ids, StringList& search_engines_used, StringList& feature_set, bool complete_only = true, bool limits_imputation = false);
148 
157  static void addCONCATSEFeatures(std::vector<PeptideIdentification>& peptide_id_list, StringList& search_engines_used, StringList& feature_set);
158 
166  static void checkExtraFeatures(const std::vector<PeptideHit> &psms, StringList& extra_features);
167 
168 
169  protected:
171  static double rescaleFragmentFeature_(double featureValue, int NumMatchedMainIons);
172 
174  static void assignDeltaScore_(std::vector<PeptideHit>& hits, String score_ref, String output_ref);
175 
177  static String getScanMergeKey_(std::vector<PeptideIdentification>::iterator it, std::vector<PeptideIdentification>::iterator start);
178 
181  {
182  inline bool operator() (const ProteinHit& h1, const ProteinHit& h2)
183  {
184  return (h1.getAccession() < h2.getAccession());
185  }
186  };
187 
190  {
191  inline bool operator() (const PeptideEvidence& h1, const PeptideEvidence& h2)
192  {
193  return (h1.getProteinAccession() < h2.getProteinAccession());
194  }
195  };
196 
197  };
198 
199 } //namespace OpenMS
200 
201 
const String & getAccession() const
returns the accession of the protein
A more convenient string class.
Definition: String.h:57
Percolator feature set and integration helper.
Definition: PercolatorFeatureSetHelper.h:67
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
const String & getProteinAccession() const
get the protein accession the peptide matches to. If not available the empty string is returned...
Representation of a peptide evidence.
Definition: PeptideEvidence.h:50
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:73
Representation of a protein hit.
Definition: ProteinHit.h:53
For accession dependent sorting of ProteinHits.
Definition: PercolatorFeatureSetHelper.h:180
For accession dependent sorting of PeptideEvidences.
Definition: PercolatorFeatureSetHelper.h:189