All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
PeptideIndexing.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: Chris Bielow $
6 // $Authors: Chris Bielow $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
21 
22 namespace OpenMS
23 {
24 
88  class OPENMS_DLLAPI PeptideIndexing :
89  public DefaultParamHandler, public ProgressLogger
90  {
91 public:
93  static char const* const AUTO_MODE; /* = 'auto' */
94 
96  enum ExitCodes
97  {
102  UNEXPECTED_RESULT
103  };
104 
106  enum class Unmatched
107  {
108  IS_ERROR,
109  WARN,
110  REMOVE,
111  SIZE_OF_UNMATCHED
112  };
113  static const std::array<std::string, (Size)Unmatched::SIZE_OF_UNMATCHED> names_of_unmatched;
114 
115  enum class MissingDecoy
116  {
117  IS_ERROR,
118  WARN,
119  SILENT,
120  SIZE_OF_MISSING_DECOY
121  };
122  static const std::array<std::string, (Size)MissingDecoy::SIZE_OF_MISSING_DECOY> names_of_missing_decoy;
123 
126 
128  ~PeptideIndexing() override;
129 
131  ExitCodes run(std::vector<FASTAFile::FASTAEntry>& proteins, std::vector<ProteinIdentification>& prot_ids, PeptideIdentificationList& pep_ids);
132 
168  ExitCodes run(FASTAContainer<TFI_File>& proteins, std::vector<ProteinIdentification>& prot_ids, PeptideIdentificationList& pep_ids);
169 
171  ExitCodes run(FASTAContainer<TFI_Vector>& proteins, std::vector<ProteinIdentification>& prot_ids, PeptideIdentificationList& pep_ids);
172 
174  const String& getDecoyString() const;
175 
177  bool isPrefix() const;
178 
179  protected:
180  void updateMembers_() override;
181 
182  template<typename T> ExitCodes run_(FASTAContainer<T>& proteins, std::vector<ProteinIdentification>& prot_ids, PeptideIdentificationList& pep_ids);
183 
184  String decoy_string_{};
185  bool prefix_{ false };
186  MissingDecoy missing_decoy_action_ = MissingDecoy::IS_ERROR;
187  String enzyme_name_{};
188  String enzyme_specificity_{};
189 
190  bool write_protein_sequence_{ false };
191  bool write_protein_description_{ false };
192  bool keep_unreferenced_proteins_{ false };
193  Unmatched unmatched_action_ = Unmatched::IS_ERROR;
194  bool IL_equivalent_{ false };
195  bool allow_nterm_protein_cleavage_{ true };
196 
197  Int aaa_max_{0};
198  Int mm_max_{0};
199  };
200 }
201 
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
Container for peptide identifications from multiple spectra.
Definition: PeptideIdentificationList.h:66
Refreshes the protein references for all peptide hits in a vector of PeptideIdentifications and adds ...
Definition: PeptideIndexing.h:90
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:107
bool isPrefix() const
Is the decoy string position a prefix or suffix?
ExitCodes run_(FASTAContainer< T > &proteins, std::vector< ProteinIdentification > &prot_ids, PeptideIdentificationList &pep_ids)
MissingDecoy
Definition: PeptideIndexing.h:116
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:93
ExitCodes run(std::vector< FASTAFile::FASTAEntry > &proteins, std::vector< ProteinIdentification > &prot_ids, PeptideIdentificationList &pep_ids)
forward for old interface and pyOpenMS; use other run() methods for more control
ExitCodes run(FASTAContainer< TFI_Vector > &proteins, std::vector< ProteinIdentification > &prot_ids, PeptideIdentificationList &pep_ids)
Same as run() with TFI_File, but for proteins which are already in memory.
~PeptideIndexing() override
Default destructor.
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:97
@ PEPTIDE_IDS_EMPTY
Definition: PeptideIndexing.h:100
@ ILLEGAL_PARAMETERS
Definition: PeptideIndexing.h:101
@ DATABASE_EMPTY
Definition: PeptideIndexing.h:99
@ EXECUTION_OK
Definition: PeptideIndexing.h:98
ExitCodes run(FASTAContainer< TFI_File > &proteins, std::vector< ProteinIdentification > &prot_ids, PeptideIdentificationList &pep_ids)
Re-index peptide identifications honoring enzyme cutting rules, ambiguous amino acids and target/deco...
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