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 
40  static std::vector<PeptideIdentification> load(const String& pin_file,
41  bool higher_score_better,
42  const String& score_name,
43  const StringList& extra_scores,
44  StringList& filenames,
45  String decoy_prefix = "");
46 
47  // uses spectrum_reference, if empty uses spectrum_id, if also empty fall back to using index
48  static String getScanIdentifier(const PeptideIdentification& pid, size_t index);
49 
50  protected:
51 
52  //id <tab> label <tab> scannr <tab> calcmass <tab> expmass <tab> feature1 <tab> ... <tab> featureN <tab> peptide <tab> proteinId1 <tab> .. <tab> proteinIdM
54  const std::vector<PeptideIdentification>& peptide_ids,
55  const StringList& feature_set,
56  const std::string& enz,
57  int min_charge,
58  int max_charge);
59 
60  static bool isEnz_(const char& n, const char& c, const std::string& enz);
61 
62  static Size countEnzymatic_(const String& peptide, const std::string& enz);
63 
64  };
65 } // 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 bool isEnz_(const char &n, const char &c, const std::string &enz)
static Size countEnzymatic_(const String &peptide, const std::string &enz)
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="")
load pin file and convert to a vector of PeptideIdentification using the given score column score_nam...
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