Identity Testing For Monosaccharides

glypy.io.nomenclature.identity.get_preferred_name(name, selector=<built-in function min>, key=<built-in function len>)[source]

Given a name, of its synonyms, find the name that satisfies the selector criterion function (min()) based on some key function of the name (len())

Parameters:

name: str

Given name to compare to synonyms

selector: function

Function to use to select the preferred name by some statistic

key: function

Function to use to convert names into statistics

Returns:

str

glypy.io.nomenclature.identity.identify(node, blacklist=None, tolerance=0, include_modifications=True, include_substituents=True)[source]

Attempt to find a common usage name for the given Monosaccharide, node. The name is determined by performing an incremental comparison of the traits of node with each named residue in the database accessed at glypy.monosaccharides.

Parameters:

node: Monosaccharide

Object to be identified

blacklist: list

The set of all monosaccharides to not attempt matching against, because they are too general.

tolerance: int

The error tolerance for the search

include_modifications: bool

Whether or not to include modifications in comparison. Defaults to True

include_substituents: bool

Whether or not to include substituents in comparison. Defaults to True

Returns:

str

Raises:

IdentifyException:

When a suitable name cannot be found.

See also

is_a, preferred_name, monosaccharide_similarity

glypy.io.nomenclature.identity.is_a(node, target, tolerance=0, include_modifications=True, include_substituents=True, exact=True, short_circuit=False)[source]

Perform a semi-fuzzy match between node and target where node is the unqualified residue queried and target is the known residue to be matched against

Parameters:

node: Monosaccharide or Substituent

Object to be identified

target: Monosaccharide, Substituent or str

The reference type. May be a str object which is used to look up a Monosaccharide by name in glypy.monosaccharides

tolerance: int

The error tolerance for the search

include_modifications: bool

Whether or not to include modifications in comparison. Defaults to True

include_substituents: bool

Whether or not to include substituents in comparison. Defaults to True

exact: bool

Whether or not to penalize for unmatched attachments. Defaults to True

Returns:

bool

glypy.io.nomenclature.identity.naive_name_monosaccharide(monosaccharide)[source]

Generate a generic name for monosaccharide, based loosely on IUPAC naming schema without including information about linkage.

The tendency for monosaccharides of superclass > 7 to have special names, which will be used preferentially if possible.

Parameters:

monosaccharide: Monosaccharide

Returns:

str:

A simple name based on SuperClass, modifications, and substituents.