Skip to contents

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. WURCS

  6. pGlyco

  7. StrucGP

Usage

auto_parse(x)

Arguments

x

A character vector of structure strings.

Value

A glycan graph if x is a single character, or a list of glycan graphs if x is a character vector.

Examples

# Single structure
x <- "Gal(b1-3)GlcNAc(b1-4)Glc(a1-"  # IUPAC-condensed
auto_parse(x)
#> <glycan_structure[1]>
#> [1] Gal(b1-3)GlcNAc(b1-4)Glc(a1-
#> # Unique structures: 1

# Mixed types
x <- c(
  "Gal(b1-3)GlcNAc(b1-4)Glc(a1-",  # IUPAC-condensed
  "Neu5Aca3Gala3(Fuca6)GlcNAcb-"  # IUPAC-short
)
auto_parse(x)
#> <glycan_structure[2]>
#> [1] Gal(b1-3)GlcNAc(b1-4)Glc(a1-
#> [2] Neu5Ac(a2-3)Gal(a1-3)[Fuc(a1-6)]GlcNAc(b1-
#> # Unique structures: 2