parse_glycoct: Parse GlycoCT Structures

View source: R/parse-glycoct.R

parse_glycoctR Documentation

Parse GlycoCT Structures

Description

This function parses GlycoCT strings into a glyrepr::glycan_structure(). GlycoCT is a format used by databases like GlyTouCan and GlyGen.

Usage

parse_glycoct(
  x,
  on_failure = "error",
  progress = FALSE,
  validate = lifecycle::deprecated()
)

Arguments

x

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

validate

Deprecated and ignored. Array records are always validated by glyrepr::structure_from_arrays().

Details

GlycoCT format consists of:

  • RES: Contains monosaccharides (lines starting with 'b:') and substituents (lines starting with 's:')

  • LIN: Contains linkage information between residues

  • UND: Contains floating substructures or substituents whose attachment to the main glycan is unresolved

Main reducing-end alditol residues retain their alditol status and use an unknown anomer configuration.

For more information about GlycoCT format, see the glycoct.md documentation.

Value

A glyrepr::glycan_structure() object.

Examples

glycoct <- paste0(
  "RES\n",
  "1b:a-dgal-HEX-1:5\n",
  "2s:n-acetyl\n",
  "3b:b-dgal-HEX-1:5\n",
  "LIN\n",
  "1:1d(2+1)2n\n",
  "2:1o(3+1)3d"
)
parse_glycoct(glycoct)


glyparse documentation built on Oct. 31, 2026, 9:06 a.m.