get_structure_graphs: Access Individual Glycan Structures

View source: R/structure.R

get_structure_graphsR Documentation

Access Individual Glycan Structures

Description

Extract individual glycan structure graphs from a glycan structure vector. A structure with floating parts is returned as one annotated, weakly disconnected igraph: its main tree and floating components share the graph, and the floating_parts graph attribute records each component's node indices, virtual attachment, and candidate parents. See glycan_structure() for the metadata schema. A structure with floating substituents carries a floating_substituents graph attribute containing their tokens and candidate parent indices.

Usage

get_structure_graphs(x, return_list = NULL)

Arguments

x

A glycan structure vector.

return_list

If TRUE, always returns a list. If FALSE and x has a length of 1, return the igraph object directly. If not provided (default), FALSE when x has a length of 1 and TRUE otherwise, including for an empty vector.

Value

A list of igraph objects or an igraph object directly (see return_list parameter).

Examples

structures <- c(o_glycan_core_1(), n_glycan_core())
get_structure_graphs(structures)
get_structure_graphs(structures)


glyrepr documentation built on Sept. 22, 2026, 5:09 p.m.