OpenMS
PeptideIndexing.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: Chris Bielow $
6 // $Authors: Chris Bielow $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
20 
21 namespace OpenMS
22 {
23 
87  class OPENMS_DLLAPI PeptideIndexing :
88  public DefaultParamHandler, public ProgressLogger
89  {
90 public:
92  static char const* const AUTO_MODE; /* = 'auto' */
93 
95  enum ExitCodes
96  {
101  UNEXPECTED_RESULT
102  };
103 
105  enum class Unmatched
106  {
107  IS_ERROR,
108  WARN,
109  REMOVE,
110  SIZE_OF_UNMATCHED
111  };
112  static const std::array<std::string, (Size)Unmatched::SIZE_OF_UNMATCHED> names_of_unmatched;
113 
114  enum class MissingDecoy
115  {
116  IS_ERROR,
117  WARN,
118  SILENT,
119  SIZE_OF_MISSING_DECOY
120  };
121  static const std::array<std::string, (Size)MissingDecoy::SIZE_OF_MISSING_DECOY> names_of_missing_decoy;
122 
125 
127  ~PeptideIndexing() override;
128 
130  ExitCodes run(std::vector<FASTAFile::FASTAEntry>& proteins, std::vector<ProteinIdentification>& prot_ids, std::vector<PeptideIdentification>& pep_ids);
131 
167  ExitCodes run(FASTAContainer<TFI_File>& proteins, std::vector<ProteinIdentification>& prot_ids, std::vector<PeptideIdentification>& pep_ids);
168 
170  ExitCodes run(FASTAContainer<TFI_Vector>& proteins, std::vector<ProteinIdentification>& prot_ids, std::vector<PeptideIdentification>& pep_ids);
171 
173  const String& getDecoyString() const;
174 
176  bool isPrefix() const;
177 
178  protected:
179  void updateMembers_() override;
180 
181  template<typename T> ExitCodes run_(FASTAContainer<T>& proteins, std::vector<ProteinIdentification>& prot_ids, std::vector<PeptideIdentification>& pep_ids);
182 
183  String decoy_string_{};
184  bool prefix_{ false };
185  MissingDecoy missing_decoy_action_ = MissingDecoy::IS_ERROR;
186  String enzyme_name_{};
187  String enzyme_specificity_{};
188 
189  bool write_protein_sequence_{ false };
190  bool write_protein_description_{ false };
191  bool keep_unreferenced_proteins_{ false };
192  Unmatched unmatched_action_ = Unmatched::IS_ERROR;
193  bool IL_equivalent_{ false };
194  bool allow_nterm_protein_cleavage_{ true };
195 
196  Int aaa_max_{0};
197  Int mm_max_{0};
198  };
199 }
200 
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:66
FASTAContainer<TFI_File> will make FASTA entries available chunk-wise from start to end by loading it...
Definition: FASTAContainer.h:68
FASTAContainer<TFI_Vector> simply takes an existing vector of FASTAEntries and provides the same inte...
Definition: FASTAContainer.h:220
Refreshes the protein references for all peptide hits in a vector of PeptideIdentifications and adds ...
Definition: PeptideIndexing.h:89
const String & getDecoyString() const
Which string is used to determine if a protein is a decoy or not.
Unmatched
Action to take when peptide hits could not be matched.
Definition: PeptideIndexing.h:106
bool isPrefix() const
Is the decoy string position a prefix or suffix?
ExitCodes run_(FASTAContainer< T > &proteins, std::vector< ProteinIdentification > &prot_ids, std::vector< PeptideIdentification > &pep_ids)
ExitCodes run(FASTAContainer< TFI_Vector > &proteins, std::vector< ProteinIdentification > &prot_ids, std::vector< PeptideIdentification > &pep_ids)
Same as run() with TFI_File, but for proteins which are already in memory.
MissingDecoy
Definition: PeptideIndexing.h:115
static char const *const AUTO_MODE
name of enzyme/specificity which signals that the enzyme/specificity should be taken from meta inform...
Definition: PeptideIndexing.h:92
ExitCodes run(std::vector< FASTAFile::FASTAEntry > &proteins, std::vector< ProteinIdentification > &prot_ids, std::vector< PeptideIdentification > &pep_ids)
forward for old interface and pyOpenMS; use other run() methods for more control
~PeptideIndexing() override
Default destructor.
ExitCodes run(FASTAContainer< TFI_File > &proteins, std::vector< ProteinIdentification > &prot_ids, std::vector< PeptideIdentification > &pep_ids)
Re-index peptide identifications honoring enzyme cutting rules, ambiguous amino acids and target/deco...
PeptideIndexing()
Default constructor.
void updateMembers_() override
This method is used to update extra member variables at the end of the setParameters() method.
ExitCodes
Exit codes.
Definition: PeptideIndexing.h:96
@ PEPTIDE_IDS_EMPTY
Definition: PeptideIndexing.h:99
@ ILLEGAL_PARAMETERS
Definition: PeptideIndexing.h:100
@ DATABASE_EMPTY
Definition: PeptideIndexing.h:98
@ EXECUTION_OK
Definition: PeptideIndexing.h:97
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:27
A more convenient string class.
Definition: String.h:34
int Int
Signed integer type.
Definition: Types.h:72
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:97
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
template parameter for vector-based FASTA access
Definition: FASTAContainer.h:56