parse_iupac_compact: Parse IUPAC-compact Structures

View source: R/parse-iupac-compact.R

parse_iupac_compactR Documentation

Parse IUPAC-compact Structures

Description

Parse IUPAC-compact strings into a glyrepr::glycan_structure().

Usage

parse_iupac_compact(x, on_failure = "error", progress = FALSE)

Arguments

x

A character vector of IUPAC-compact strings. NA values are allowed and will be returned as NA structures.

on_failure

How to handle parsing failures. "error" aborts when a structure cannot be parsed. "na" returns NA at invalid positions.

progress

Whether to show a progress bar while parsing.

Details

IUPAC-compact notation is similar to IUPAC-condensed notation, but linkages are written directly after the monosaccharide, such as "Galb1-3GlcNAc", and branches are written in parentheses. The parser normalizes compact notation into IUPAC-condensed notation, then uses the IUPAC-condensed parser to construct the glycan structure.

Alditol glycans marked with +aldi retain their alditol status and use an unknown reducing-end anomer configuration.

Value

A glyrepr::glycan_structure() object.

See Also

parse_iupac_condensed()

Examples

iupac <- "Mana1-3(Mana1-6)Manb1-4GlcNAcb"
parse_iupac_compact(iupac)


glyparse documentation built on Oct. 30, 2026, 9:10 a.m.