Utilities and commonly reused generics¶
glypy reuses several common structures and functions throughout the
library. Some of these features are intended to be internal only. Those that
affect the object interfaces that users see are described here.
User-Facing Utilities¶
- glypy.utils.base.root(structure: Rootable)[source]¶
A generic method for obtaining the root of a structure representing or containing a glycan graph with a single distinct root.
Implementing objects should provide a
__root__method that returns aMonosaccharideobject.
- glypy.utils.base.tree(structure: Treeable)[source]¶
A generic method for obtaining the
Glycanof a structure representing or containing a glycan graph.Implementing objects should provide a
__tree__method that returns aGlycanobject.- Parameters:
structure (any) – An object that implements the
treeprotocol, containing a tree structure somewhere inside it.- Return type:
- Raises:
Error Types¶
Enum Type Implementation¶
- class glypy.utils.enum.EnumMeta¶
- class glypy.utils.enum.EnumValue¶
Represents a wrapper around an value with a name to identify it and more rich comparison logic. A value of an enumerated type
Multimap Implementation¶
Monosaccharide and Substituent objects’
store position-specific infomration about links and modifiers
using a Mapping-like object that allows a key to be
used to designate multiple values. These are usually
OrderedMultiMap objects, which remember the order in
which keys were added to them. These types are implemented in
the glypy.utils.multimap module.