OpenMS
Loading...
Searching...
No Matches
TheoreticalGlycanSpectrumGenerator Class Reference

Generate positive-mode glycan and singly glycosylated peptide fragments. More...

#include <OpenMS/CHEMISTRY/TheoreticalGlycanSpectrumGenerator.h>

Classes

struct  Fragment
 One interpretation of a fragment, including its charge and attachment. More...
 
struct  Options
 Generation settings; all size and charge ranges are inclusive. More...
 
struct  PeptideRetention
 Independent choices of glycan material retained by a backbone ion. More...
 

Public Types

enum class  IonType {
  DIAGNOSTIC , B , C , Y ,
  Z , PEPTIDE
}
 Glycan series and peptide backbone fragments are kept distinct. More...
 
enum class  FragmentationMethod { HCD , ETD , ETHCD }
 EThcD combines b/y and c/z ions with intact glycan retention. More...
 
using Composition = ProForma::GlycanComposition
 

Public Member Functions

 TheoreticalGlycanSpectrumGenerator ()
 Construct with default options.
 
 TheoreticalGlycanSpectrumGenerator (const Options &options)
 Construct with validated options.
 
void setOptions (const Options &options)
 Set options; throws InvalidParameter for invalid ranges, loss formulas or rules.
 
const Options & getOptions () const
 Return the current options.
 
std::vector< Fragment > getFragments (const Composition &composition) const
 Generate diagnostic and bounded composition B/Y (optionally C/Z) ions.
 
std::vector< Fragment > getFragments (const GlycanStructure &structure) const
 Generate structural B/Y/C/Z and internal B fragments from a tree.
 
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< Fragment > getGlycopeptideFragments (const AASequence &peptide, const GlycanStructure &structure, Size attachment_position, FragmentationMethod method) const
 As above, using topology for glycan fragments.
 

Static Public Member Functions

static MSSpectrum toSpectrum (const std::vector< Fragment > &fragments)
 Convert fragment interpretations to a fresh annotated MS2 spectrum.
 

Private Member Functions

std::vector< Fragment > generate_ (const Composition &composition, const GlycanStructure *structure, const AASequence *peptide, Size site, FragmentationMethod method) const
 

Private Attributes

Options options_
 

Detailed Description

Generate positive-mode glycan and singly glycosylated peptide fragments.

Composition fragments are explicitly labelled as such: their compositions are possibilities, not claims about topology. Structural fragments are connected subtrees. A B fragment carries a root cleavage and, for internal fragments, additional branch cleavages. Y fragments retain the reducing end. Node indices identify cleaved bonds by their non-reducing-side node (zero is the attachment).

Residue formulas exclude water: B = residue sum, C = B + H2O, Y = reducing end + retained residues, Z = Y - H2O per branch cleavage. Free glycans use H2O as the reducing end; glycopeptides use the peptide. Positive charges add protons. Intensities are uniformly 1, not predicted.

mzPAF does not define glycan series. getAnnotation() therefore uses its named compound syntax, keeping topology/composition and attachment in the name. Resource limits fail explicitly rather than returning a truncated spectrum.

See also
glycan_fragmentation

Class Documentation

◆ OpenMS::TheoreticalGlycanSpectrumGenerator::Options

struct OpenMS::TheoreticalGlycanSpectrumGenerator::Options

Generation settings; all size and charge ranges are inclusive.

Class Members
bool add_b_ions = true
bool add_c_ions = false
bool add_diagnostic_ions = true
bool add_internal_fragments = true
bool add_y_ions = true
bool add_z_ions = false
bool allow_structural = true False selects the composition fallback even for a tree.
Int max_charge = 2
Size max_cleavages = 2 Includes the root cleavage of B/internal fragments.
Size max_composition_size = 3 Y0 is included separately when Y is enabled.
Size max_fragments = 10000 Includes charge states, losses and peptide fragments.
Int max_oxonium_charge = 1
Size max_states = 100000 Also bounds enumeration work, including rejected candidates.
Int min_charge = 1
Size min_composition_size = 1 Retained residues for both composition B and Y.
Int min_oxonium_charge = 1
vector< EmpiricalFormula > neutral_losses Single losses, not a combinatorial loss ladder.
map< char, PeptideRetention > peptide_retention Optional overrides for b/y/c/z.
map< string, vector< EmpiricalFormula > > specific_neutral_losses Applied only if that residue is retained.

◆ OpenMS::TheoreticalGlycanSpectrumGenerator::PeptideRetention

struct OpenMS::TheoreticalGlycanSpectrumGenerator::PeptideRetention

Independent choices of glycan material retained by a backbone ion.

Class Members
bool intact = false Include the complete glycan.
bool stripped = true Include the peptide with no glycan.
vector< Composition > stubs Explicit retained compositions, each a subset of the input.

Member Typedef Documentation

◆ Composition

Member Enumeration Documentation

◆ FragmentationMethod

enum class FragmentationMethod
strong

EThcD combines b/y and c/z ions with intact glycan retention.

Enumerator
HCD 
ETD 
ETHCD 

◆ IonType

enum class IonType
strong

Glycan series and peptide backbone fragments are kept distinct.

Enumerator
DIAGNOSTIC 
B 
C 
Y 
Z 
PEPTIDE 

Constructor & Destructor Documentation

◆ TheoreticalGlycanSpectrumGenerator() [1/2]

Construct with default options.

◆ TheoreticalGlycanSpectrumGenerator() [2/2]

TheoreticalGlycanSpectrumGenerator ( const Options &  options)
explicit

Construct with validated options.

Member Function Documentation

◆ generate_()

std::vector< Fragment > generate_ ( const Composition &  composition,
const GlycanStructure *  structure,
const AASequence *  peptide,
Size  site,
FragmentationMethod  method 
) const
private

◆ getFragments() [1/2]

std::vector< Fragment > getFragments ( const Composition &  composition) const

Generate diagnostic and bounded composition B/Y (optionally C/Z) ions.

Parameters
[in]compositionProForma composition, with nonnegative counts
Returns
Fragments sorted by m/z; empty input produces no ions
Exceptions
Exception::ElementNotFoundif a named monosaccharide is unknown to MonosaccharideDB
Exception::InvalidParameterfor invalid chemistry or exhausted resource limits

◆ getFragments() [2/2]

std::vector< Fragment > getFragments ( const GlycanStructure &  structure) const

Generate structural B/Y/C/Z and internal B fragments from a tree.

Parameters
[in]structureRooted glycan tree
Returns
Fragments sorted by m/z, including topology-preserving isobaric interpretations

◆ getGlycopeptideFragments() [1/2]

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.

The peptide must exclude the glycan modification; other peptide modifications are preserved. HCD defaults to b/y ions stripped or with one HexNAc (if present). ETD defaults to c/z ions with the full glycan. EThcD generates b/y/c/z ions with the full glycan; per-series overrides can add stripped/stub ions. Backbone ions named peptide:zN use the radical z+1 form (Residue::Zp1Ion) for both ETD and EThcD; this is distinct from the glycan Z series. Only backbone fragments containing the attachment receive retained glycan mass. Explicit stubs allow, for example, HexNAc+Fuc retention without assuming a core topology from a composition. ETD omits glycan cleavage ions by default.

Parameters
[in]peptidePeptide without its glycan modification
[in]compositionGlycan composition
[in]attachment_positionZero-based residue index in the peptide
[in]methodFragmentation method
Returns
Fragments sorted by m/z
Exceptions
Exception::ElementNotFoundif a named monosaccharide is unknown to MonosaccharideDB
Exception::InvalidParameterfor an empty glycan, invalid site, or impossible stub

◆ getGlycopeptideFragments() [2/2]

std::vector< Fragment > getGlycopeptideFragments ( const AASequence &  peptide,
const GlycanStructure &  structure,
Size  attachment_position,
FragmentationMethod  method 
) const

As above, using topology for glycan fragments.

◆ getOptions()

const Options & getOptions ( ) const

Return the current options.

◆ setOptions()

void setOptions ( const Options &  options)

Set options; throws InvalidParameter for invalid ranges, loss formulas or rules.

◆ toSpectrum()

static MSSpectrum toSpectrum ( const std::vector< Fragment > &  fragments)
static

Convert fragment interpretations to a fresh annotated MS2 spectrum.

Parameters
[in]fragmentsFragments to convert
Returns
Sorted spectrum with aligned IonNames (mzPAF) and Charges arrays

Member Data Documentation

◆ options_

Options options_
private