Exemplo n.º 1
0
from glypy.composition.structure_composition import substituent_compositions
from glypy.composition.composition_transform import has_derivatization, derivatize
from glypy.io import format_constants_map
from glypy.io.nomenclature import identity
from glypy.utils import invert_dict

from glypy.io.file_utils import ParserInterface, ParserError


# A static copy of monosaccharide names to structures for copy-free comparison
monosaccharide_reference = {k: v for k, v in named_structures.monosaccharides.items()}


anomer_map_from = dict(format_constants_map.anomer_map)
anomer_map_from['?'] = anomer_map_from.pop('x')
anomer_map_to = invert_dict(anomer_map_from)
anomer_map_from['beta'] = anomer_map_from['b']
anomer_map_from['alpha'] = anomer_map_from['a']


Stem = constants.Stem
Configuration = constants.Configuration
Modification = constants.Modification
SuperClass = constants.SuperClass


def tryint(i):
    try:
        return int(i)
    except ValueError:
        return -1
Exemplo n.º 2
0
    ("Kdo", "W"),
    ("GalA", "L"),
    ("IdoA", "I"),
    ("Rha", "H"),
    ("Fuc", "F"),
    ("Xyl", "X"),
    ("Rib", "B"),
    ("Ara", "R"),
    ("GlcA", "U"),
    ("All", 'O'),
    ("Api", 'P'),
    ("Fru", "E")
))

#: A mapping from symbol to common monosaccharide name
monosaccharides_from = invert_dict(dict(monosaccharides_to))

#: A mapping from common substituent names to symbol
substituents_to = {
    'amino': 'Q',
    'ethanolominephosphate': 'PE',
    'inositol': "IN",
    'methyl': "ME",
    'n_acetyl': 'N',
    'o_acetyl': 'T',
    'phosphate': 'P',
    'phosphocholine': "PC",
    'pyruvate': 'PYR',
    'sulfate': 'S',
    'sulfide': 'SH',
    '2-aminoethylphosphonic acid': 'EP'