Skip to contents

This function parses GlycoCT strings into glycan graphs. GlycoCT is a format used by databases like GlyTouCan and GlyGen.

Usage

parse_glycoct(x)

Arguments

x

A character vector of GlycoCT strings.

Value

A glycan_structure object if x is a single character, or a glycan_structure vector if x is a character vector.

Details

GlycoCT format consists of two parts:

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

  • LIN: Contains linkage information between residues

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

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)
#> <glycan_structure[1]>
#> [1] Gal(b1-3)GalNAc(a1-
#> # Unique structures: 1