Visualization

Graphical Visualization

We can use GlyLES to visualize glycans on a monomer level. This is done by computing a graphical representation of the glycan in form of a DOT-graph of the monomeric tree-structure in vertical orientation …

[1]:
from glyles import Glycan
from IPython.display import Image


glycan = Glycan("Fuc(a1-2)[GalNAc(a1-3)]Gal(b1-4)GlcNAc(b1-3)[Fuc(a1-2)[GalNAc(a1-3)]Gal(b1-4)GlcNAc(b1-6)]Gal(b1-3)[GlcNAc(a1-4)Gal(b1-4)GlcNAc6S(b1-6)]GalNAc", tree_only=True)
Image(glycan.save_dot("files/viz.dot").create_png())
[1]:
../_images/howto_visualization_1_0.png

… or in horizontal orientation.

[2]:
Image(glycan.save_dot("files/viz_2.dot", horizontal=True).create_png())
[2]:
../_images/howto_visualization_3_0.png

SNFG Visualization

GlyLES can also be used to visualize glycans using the symbols from the SNFG standard.

To better fit the visualization to your needs, there are some parameter, you can tune to adapt the visualization to your needs. This includes width and height of the whole image, border-size of the symbols, and line width of the edges between the symbols.

[3]:
display(glycan.create_snfg_img("files/viz_snfg.png", width=300, height=100))
../_images/howto_visualization_5_0.png

You can also get some statistics of a glycan

[4]:
for k, v in glycan.summary().items():
    print(k, ":", v)
formula : C92H153N7O67S
weight : 2459.850098435999
atoms : 167
bonds : 179
rings : 13
monomers : 13
types : {'GalNAc': 3, 'GlcNAc6S': 1, 'Gal': 4, 'GlcNAc': 3, 'Fuc': 2}
root : GalNAc
leaves : ['GlcNAc', 'GalNAc', 'Fuc', 'GalNAc', 'Fuc']
depth : 4