WURCS

Implements a reader and writer for the WURCS 2.0 format.

High Level Functions

glypy.io.wurcs.dumps(glycan)[source]

Encode a saccharide object as a WURCS 2.0 string.

Note

The WURCS canonicalization has not been implemented yet, so the generated string may differ from other sources. However, the canonicalize module can be used to standardize structures prior to encoding them.

Parameters

glycan (Glycan, GlycanComposition, or Monosaccharide) – The structure to encode

Returns

The structure encoded as a string.

Return type

str

glypy.io.wurcs.loads(text, structure_class=<class 'glypy.structure.glycan.Glycan'>)[source]

Parse a WURCS-encoded glycan structure from text into a Glycan or GlycanComposition.

Parameters
  • text (str) – The WURCS string to parse

  • structure_class (type, optional) – The class to use to wrap the Monosaccharide graph (the default is Glycan)

Returns

The parsed result

Return type

Glycan or GlycanComposition

File Parser

class glypy.io.wurcs.WURCSParser(file_spec, file_type='line')[source]

Implementation Details

class glypy.io.wurcs.NodeTypeSpec(carbon_descriptor, substituents)[source]
class glypy.io.wurcs.CarbonDescriptors(descriptors, anomer, anomeric_position, ring_start, ring_end)[source]
exception glypy.io.wurcs.WURCSError[source]

Low-Level Parser and Writer Implementations

class glypy.io.wurcs.parser.WURCSParser(line, structure_class=<class 'glypy.structure.glycan.Glycan'>)[source]
class glypy.io.wurcs.writer.WURCSWriter(glycan)[source]

Implementation of WURCS encoding process.

Includes the steps for creating each section of the WURCS encoding, and populating them from a saccharide structure, composition, or monosaccharide.