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.
Arguments
- glycan
A
glycan_structure()vector or a glycanigraph.- 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.
Examples
glycan <- o_glycan_core_1(linkage = TRUE)
has_linkages(glycan)
#> [1] TRUE
print(glycan)
#> <glycan_structure[1]>
#> [1] Gal(b1-3)GalNAc(a1-
#> # Unique structures: 1
glycan <- remove_linkages(glycan)
has_linkages(glycan)
#> [1] FALSE
print(glycan)
#> <glycan_structure[1]>
#> [1] Gal(??-?)GalNAc(??-
#> # Unique structures: 1
glycan <- as_glycan_structure("Gal(b1-?)GalNAc(a1-")
has_linkages(glycan)
#> [1] TRUE
has_linkages(glycan, strict = TRUE)
#> [1] FALSE
