OpenMS
Loading...
Searching...
No Matches
TheoreticalGlycanSpectrumGenerator.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: Timo Sachsenberg $
7// --------------------------------------------------------------------------
8
9#pragma once
10
13#include <map>
14
15namespace OpenMS
16{
17class AASequence;
18class MSSpectrum;
19
42{
43public:
45
47 enum class IonType
48 {
49 DIAGNOSTIC,
50 B,
51 C,
52 Y,
53 Z,
54 PEPTIDE
55 };
58 {
59 HCD,
60 ETD,
61 ETHCD
62 };
63
65 struct OPENMS_DLLAPI PeptideRetention
66 {
67 bool intact = false;
68 bool stripped = true;
69 std::vector<Composition> stubs;
70 };
71
73 struct OPENMS_DLLAPI Options
74 {
75 bool add_diagnostic_ions = true;
76 bool add_b_ions = true;
77 bool add_y_ions = true;
78 bool add_c_ions = false;
79 bool add_z_ions = false;
80 bool add_internal_fragments = true;
81 bool allow_structural = true;
82 Size min_composition_size = 1;
83 Size max_composition_size = 3;
84 Size max_cleavages = 2;
85 Size max_fragments = 10000;
86 Size max_states = 100000;
87 Int min_charge = 1;
88 Int max_charge = 2;
89 Int min_oxonium_charge = 1;
90 Int max_oxonium_charge = 1;
91 std::vector<EmpiricalFormula> neutral_losses;
92 std::map<std::string, std::vector<EmpiricalFormula>> specific_neutral_losses;
93 std::map<char, PeptideRetention> peptide_retention;
94 };
95
97 struct OPENMS_DLLAPI Fragment
98 {
99 IonType ion_type = IonType::DIAGNOSTIC;
101 double neutral_mass = 0.0;
102 Int charge = 1;
103 std::optional<Size> attachment_position;
105 std::optional<Size> root_cleavage;
106 std::vector<Size> branch_cleavages;
107 std::string name;
108 double getMZ() const;
110 std::string getAnnotation() const;
111 };
112
118 void setOptions(const Options& options);
120 const Options& getOptions() const;
121
129 std::vector<Fragment> getFragments(const Composition& composition) const;
130
136 std::vector<Fragment> getFragments(const GlycanStructure& structure) const;
137
159 std::vector<Fragment>
160 getGlycopeptideFragments(const AASequence& peptide, const Composition& composition, Size attachment_position, FragmentationMethod method) const;
162 std::vector<Fragment>
163 getGlycopeptideFragments(const AASequence& peptide, const GlycanStructure& structure, Size attachment_position, FragmentationMethod method) const;
164
170 static MSSpectrum toSpectrum(const std::vector<Fragment>& fragments);
171
172private:
174 std::vector<Fragment>
175 generate_(const Composition& composition, const GlycanStructure* structure, const AASequence* peptide, Size site, FragmentationMethod method) const;
176};
177} // namespace OpenMS
Definition AASequence.h:96
A rooted glycan tree, with the reducing-end monosaccharide at node zero.
Definition GlycanStructure.h:27
The representation of a 1D spectrum.
Definition MSSpectrum.h:44
Glycan composition specification.
Definition ProForma.h:240
Generate positive-mode glycan and singly glycosylated peptide fragments.
Definition TheoreticalGlycanSpectrumGenerator.h:42
IonType
Glycan series and peptide backbone fragments are kept distinct.
Definition TheoreticalGlycanSpectrumGenerator.h:48
std::vector< Fragment > getFragments(const Composition &composition) const
Generate diagnostic and bounded composition B/Y (optionally C/Z) ions.
std::vector< Fragment > generate_(const Composition &composition, const GlycanStructure *structure, const AASequence *peptide, Size site, FragmentationMethod method) const
TheoreticalGlycanSpectrumGenerator(const Options &options)
Construct with validated options.
static MSSpectrum toSpectrum(const std::vector< Fragment > &fragments)
Convert fragment interpretations to a fresh annotated MS2 spectrum.
void setOptions(const Options &options)
Set options; throws InvalidParameter for invalid ranges, loss formulas or rules.
Options options_
Definition TheoreticalGlycanSpectrumGenerator.h:173
std::vector< Fragment > getGlycopeptideFragments(const AASequence &peptide, const GlycanStructure &structure, Size attachment_position, FragmentationMethod method) const
As above, using topology for glycan fragments.
std::vector< Fragment > getFragments(const GlycanStructure &structure) const
Generate structural B/Y/C/Z and internal B fragments from a tree.
const Options & getOptions() const
Return the current options.
std::map< char, PeptideRetention > peptide_retention
Optional overrides for b/y/c/z.
Definition TheoreticalGlycanSpectrumGenerator.h:93
std::map< std::string, std::vector< EmpiricalFormula > > specific_neutral_losses
Applied only if that residue is retained.
Definition TheoreticalGlycanSpectrumGenerator.h:92
FragmentationMethod
EThcD combines b/y and c/z ions with intact glycan retention.
Definition TheoreticalGlycanSpectrumGenerator.h:58
std::vector< EmpiricalFormula > neutral_losses
Single losses, not a combinatorial loss ladder.
Definition TheoreticalGlycanSpectrumGenerator.h:91
std::vector< Fragment > getGlycopeptideFragments(const AASequence &peptide, const Composition &composition, Size attachment_position, FragmentationMethod method) const
Generate glycan and peptide fragments for one localized glycan.
std::vector< Composition > stubs
Explicit retained compositions, each a subset of the input.
Definition TheoreticalGlycanSpectrumGenerator.h:69
TheoreticalGlycanSpectrumGenerator()
Construct with default options.
Generation settings; all size and charge ranges are inclusive.
Definition TheoreticalGlycanSpectrumGenerator.h:74
Independent choices of glycan material retained by a backbone ion.
Definition TheoreticalGlycanSpectrumGenerator.h:66
@ C
c-ion (N-terminal, ETD)
@ Z
z-ion (C-terminal, ETD)
@ Y
y-ion (C-terminal)
@ B
b-ion (N-terminal)
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
One interpretation of a fragment, including its charge and attachment.
Definition TheoreticalGlycanSpectrumGenerator.h:98
std::optional< Size > attachment_position
Zero-based peptide index.
Definition TheoreticalGlycanSpectrumGenerator.h:103
std::string getAnnotation() const
Serialize as an mzPAF named compound; throws InvalidParameter for an invalid name.
Composition composition
Definition TheoreticalGlycanSpectrumGenerator.h:100
std::string attachment_residue
Definition TheoreticalGlycanSpectrumGenerator.h:104
std::string name
Nonempty uncharged name without whitespace, square brackets or NUL characters.
Definition TheoreticalGlycanSpectrumGenerator.h:107
std::optional< Size > root_cleavage
Definition TheoreticalGlycanSpectrumGenerator.h:105
std::vector< Size > branch_cleavages
Definition TheoreticalGlycanSpectrumGenerator.h:106