OpenMS
Loading...
Searching...
No Matches
CometModification.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: Timo Sachsenberg $
6// $Authors: Copilot $
7// --------------------------------------------------------------------------
8
9#pragma once
10
14
15#include <vector>
16#include <cmath>
17#include <iomanip>
18#include <sstream>
19
20namespace OpenMS
21{
22
46struct OPENMS_DLLAPI CometModification
47{
49 static constexpr double MASS_TOLERANCE = 1e-6;
50
51 double mass{0.0};
52 std::string residues;
53 int binary_group{0};
54 int max_mods_per_peptide{5};
55 int term_distance{-1};
56 int nc_term{0};
57 bool required{false};
58
60 CometModification() = default;
61
82 CometModification(const ResidueModification* mod, int binary_grp, int max_mods);
83
96 bool isMergeableWith(const CometModification& other) const;
97
114 void merge(const CometModification& other);
115
131 std::string toCometString(Size index) const;
132
145 static std::vector<CometModification> mergeModifications(const std::vector<CometModification>& mods);
146};
147
148} // namespace OpenMS
Representation of a modification on an amino acid residue.
Definition ResidueModification.h:55
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
Helper struct that represents one Comet variable_modXX entry and supports merging compatible entries.
Definition CometModification.h:47
void merge(const CometModification &other)
Merge another compatible entry into this one.
CometModification(const ResidueModification *mod, int binary_grp, int max_mods)
Build an entry from an OpenMS ResidueModification.
CometModification()=default
Default constructor; produces a zeroed entry with mass == 0.
bool isMergeableWith(const CometModification &other) const
Whether two entries can be combined into a single Comet variable_modXX line.
std::string residues
Residue(s) this modification applies to (e.g. "K", "KR", "n", "nKR").
Definition CometModification.h:52
std::string toCometString(Size index) const
Render this entry as a Comet variable_modXX parameter line.
static std::vector< CometModification > mergeModifications(const std::vector< CometModification > &mods)
Greedy first-fit merge of a vector of entries.