OpenMS
PercolatorInfile.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: Timo Sachsenberg $
6 // $Authors: Timo Sachsenberg $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
12 #include <OpenMS/FORMAT/TextFile.h>
13 
14 #include <vector>
15 
16 namespace OpenMS
17 {
18 
23  class OPENMS_DLLAPI PercolatorInfile
24  {
25  public:
26  static void store(const String& pin_file,
27  const std::vector<PeptideIdentification>& peptide_ids,
28  const StringList& feature_set,
29  const std::string& enz,
30  int min_charge,
31  int max_charge);
32 
33 
61  static std::vector<PeptideIdentification> load(const String& pin_file,
62  bool higher_score_better,
63  const String& score_name,
64  const StringList& extra_scores,
65  StringList& filenames,
66  String decoy_prefix = "",
67  double threshold = 0.01,
68  bool SageAnnotation = false);
69 
70  // uses spectrum_reference, if empty uses spectrum_id, if also empty fall back to using index
71  static String getScanIdentifier(const PeptideIdentification& pid, size_t index);
72 
73  protected:
74 
75  //id <tab> label <tab> scannr <tab> calcmass <tab> expmass <tab> feature1 <tab> ... <tab> featureN <tab> peptide <tab> proteinId1 <tab> .. <tab> proteinIdM
77  const std::vector<PeptideIdentification>& peptide_ids,
78  const StringList& feature_set,
79  const std::string& enz,
80  int min_charge,
81  int max_charge);
82 
83  static bool isEnz_(const char& n, const char& c, const std::string& enz);
84 
85  static Size countEnzymatic_(const String& peptide, const std::string& enz);
86 
87  };
88 } // namespace OpenMS
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:39
Class for storing Percolator tab-delimited input files.
Definition: PercolatorInfile.h:24
static String getScanIdentifier(const PeptideIdentification &pid, size_t index)
static TextFile preparePin_(const std::vector< PeptideIdentification > &peptide_ids, const StringList &feature_set, const std::string &enz, int min_charge, int max_charge)
static std::vector< PeptideIdentification > load(const String &pin_file, bool higher_score_better, const String &score_name, const StringList &extra_scores, StringList &filenames, String decoy_prefix="", double threshold=0.01, bool SageAnnotation=false)
Loads peptide identifications from a Percolator input file.
static bool isEnz_(const char &n, const char &c, const std::string &enz)
static Size countEnzymatic_(const String &peptide, const std::string &enz)
static void store(const String &pin_file, const std::vector< PeptideIdentification > &peptide_ids, const StringList &feature_set, const std::string &enz, int min_charge, int max_charge)
A more convenient string class.
Definition: String.h:34
Definition: TextFile.h:21
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:97
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:44
const double c
Definition: Constants.h:188
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19