tests/testthat/test-parse-strucgp.R

test_that("A2B2C1D1E2F1G3gfF5fedD1E2F1feE2F1fedcba", {
  skip_on_old_win()
  glycan <- parse_strucgp_struc("A2B2C1D1E2F1G3gfF5fedD1E2F1feE2F1fedcba")
  expect_snapshot(print(glycan, verbose = TRUE))
})


test_that("A2B2C1D1E1F1fedD1E1F1feE1F1fedcba", {
  skip_on_old_win()
  glycan <- parse_strucgp_struc("A2B2C1D1E1F1fedD1E1F1feE1F1fedcba")
  expect_snapshot(print(glycan, verbose = TRUE))
})


test_that("StrucGP array assembly preserves branched topology", {
  graph <- parse_strucgp_struc_arrays(
    "A2B2C1D1E2F1fedD1E2edcbB5ba"
  )

  expect_identical(
    matrix(as.character(graph$edges), ncol = 2, byrow = TRUE),
    matrix(
      c(
        "1",
        "2",
        "2",
        "3",
        "3",
        "4",
        "4",
        "5",
        "5",
        "6",
        "3",
        "7",
        "7",
        "8",
        "1",
        "9"
      ),
      ncol = 2,
      byrow = TRUE
    )
  )
  expect_identical(
    graph$mono,
    c(
      "HexNAc",
      "HexNAc",
      "Hex",
      "Hex",
      "HexNAc",
      "Hex",
      "Hex",
      "HexNAc",
      "dHex"
    )
  )
  expect_identical(
    graph$linkage,
    rep("??-?", 8)
  )
})

Try the glyparse package in your browser

Any scripts or data that you put into this service are public.

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