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

A rooted glycan tree, with the reducing-end monosaccharide at node zero. More...

#include <OpenMS/CHEMISTRY/GlycanStructure.h>

Classes

struct  Node
 A monosaccharide and its linkage towards the reducing end. More...
 

Public Member Functions

Size addMonosaccharide (const ProForma::GlycanComposition::Monosaccharide &monosaccharide, std::optional< Size > parent=std::nullopt, const std::string &linkage="")
 Add the root or a child and return its stable index.
 
const std::vector< Node > & getNodes () const
 Return the nodes in insertion order.
 
ProForma::GlycanComposition getComposition () const
 Return the composition, retaining named and formula components.
 

Private Attributes

std::vector< Node > nodes_
 

Detailed Description

A rooted glycan tree, with the reducing-end monosaccharide at node zero.

Nodes have stable, zero-based indices. Each new node is attached to an existing parent, so disconnected graphs and cycles cannot be constructed. Linkage labels (for example "beta1-4") are optional metadata; glycosidic fragment masses do not depend on them. Monosaccharide formulas describe residues (water excluded), as in ProForma. This is not a WURCS parser or a GNOme resolver.


Class Documentation

◆ OpenMS::GlycanStructure::Node

struct OpenMS::GlycanStructure::Node

A monosaccharide and its linkage towards the reducing end.

Class Members
string linkage
Monosaccharide monosaccharide
optional< Size > parent

Member Function Documentation

◆ addMonosaccharide()

Size addMonosaccharide ( const ProForma::GlycanComposition::Monosaccharide &  monosaccharide,
std::optional< Size >  parent = std::nullopt,
const std::string &  linkage = "" 
)

Add the root or a child and return its stable index.

Parameters
[in]monosaccharideNamed residue or neutral, positive empirical formula
[in]parentNo value for the root; an existing node index otherwise
[in]linkageOptional linkage description
Exceptions
Exception::InvalidParameterfor an invalid parent or charged/empty formula
Exception::ElementNotFoundfor an unknown monosaccharide

◆ getComposition()

ProForma::GlycanComposition getComposition ( ) const

Return the composition, retaining named and formula components.

◆ getNodes()

const std::vector< Node > & getNodes ( ) const

Return the nodes in insertion order.

Member Data Documentation

◆ nodes_

std::vector<Node> nodes_
private