auto_parse: Automatic Structure Parsing

View source: R/auto-parse.R

auto_parseR Documentation

Automatic Structure Parsing

Description

Detect the structure string type and use the appropriate parser to parse automatically. Mixed types are supported.

Supported types:

  1. GlycoCT

  2. IUPAC-condensed

  3. IUPAC-extended

  4. IUPAC-short

  5. GlyCAM IUPAC

  6. IUPAC-compact

  7. WURCS

  8. Linear Code

  9. pGlyco

  10. StrucGP

  11. KCF

  12. LINUCS

  13. GlycoWorkbench

Usage

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

Arguments

x

A character vector of structure 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.

Value

A glyrepr::glycan_structure() object.

Examples

# Single structure
x <- "Gal(b1-3)GlcNAc(b1-4)Glc(a1-"  # IUPAC-condensed
auto_parse(x)

# Mixed types
x <- c(
  "Gal(b1-3)GlcNAc(b1-4)Glc(a1-",  # IUPAC-condensed
  "Neu5Aca3Gala3(Fuca6)GlcNAcb-"  # IUPAC-short
)
auto_parse(x)


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