has_linkages: Determine if a Glycan Structure has Linkages

View source: R/linkage.R

has_linkagesR Documentation

Determine if a Glycan Structure has Linkages

Description

Unknown linkages in a glycan structure are represented by "??-?". Also, a linkage can be partially known (e.g. "a?-?"). This function checks if a glycan structure has linkages, in a strict or lenient way.

Usage

has_linkages(glycan, strict = FALSE)

Arguments

glycan

A glycan_structure() vector or a glycan igraph.

strict

A logical value.

  • If FALSE (default), a glycan is considered to have linkages if any linkage is partially known (not "??-?").

  • If TRUE, a glycan is considered to have linkages only if all linkages are fully determined (no "?" or multiple positions in the linkage). Linkages include both graph edges and the virtual attachment linkage of each floating part.

Value

A logical vector for structure-vector input, or a logical scalar for graph input.

See Also

remove_linkages(), possible_linkages()

Examples

glycan <- o_glycan_core_1(linkage = TRUE)
has_linkages(glycan)
print(glycan)

glycan <- remove_linkages(glycan)
has_linkages(glycan)
print(glycan)

glycan <- as_glycan_structure("Gal(b1-?)GalNAc(a1-")
has_linkages(glycan)
has_linkages(glycan, strict = TRUE)


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