structure_component_membership: Identify Main and Floating Structure Components

View source: R/structure-tables.R

structure_component_membershipR Documentation

Identify Main and Floating Structure Components

Description

structure_component_membership() identifies whether each glycan node belongs to the main tree or to a floating part. It provides a public, normalized alternative to reading the private floating-part graph attribute.

Main-tree nodes have component_type = "main" and a missing part_id. Nodes in a floating subtree have component_type = "floating" and the corresponding part_id from structure_floating_parts(). Floating substituents do not introduce vertices, so they do not create additional component-membership rows.

Node indices refer to structure_nodes()$node_id for the same glycan. Missing structures contribute no rows. Duplicate structures are expanded to their original vector positions. For graph input, node indices are current numeric vertex positions and glycan_id is 1L. If vector input is named, the result also contains a glycan_name column.

Usage

structure_component_membership(x)

Arguments

x

A glycan structure vector or one glycan igraph.

Value

A tibble with columns glycan_id, node_id, component_type, and part_id, plus glycan_name when x is named.

Examples

glycan <- as_glycan_structure(
  "{Neu5Ac(a2-6)|2,3}Gal(b1-3)GalNAc(a1-"
)
structure_component_membership(glycan)


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