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)[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 aMonosaccharide
object.
- glypy.utils.base.tree(structure)[source]¶
A generic method for obtaining the
Glycan
of a structure representing or containing a glycan graph.Implementing objects should provide a
__tree__
method that returns aGlycan
object.- Parameters
structure (any) – An object that implements the
tree
protocol, 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.