R/plot_glyco_traits.R
plot_glycan_tree.RdVisualize a glycan structure encoded as an igraph object produced by
build_glycan_igraph. This plot is mainly intended for inspecting
glycan topology (branching, residue types, connectivity).
plot_glycan_tree(g)An igraph object representing a glycan tree from build_glycan_igraph.
A glycan topology plot is drawn as a side effect.
# Example: parse a pGlyco3-style glycan expression into a tree
pGlyco_expr <- "(N(N(H(H(H))(H(H)(H)(H(H))))))"
# Convert to glycan tree structure
tree <- pGlyco3_to_tree(pGlyco_expr)
# Explore parsed nodes and edges
tree$node
#> [1] "N" "N" "H" "H" "H" "H" "H" "H" "H" "H"
tree$edge
#> [1] "a-b" "b-c" "c-d" "d-e" "c-f" "f-g" "f-h" "f-i" "i-j"
# Build igraph representation
g <- build_glycan_igraph(tree)
plot_glycan_tree(g)