R/anomer.R

Defines functions get_anomer

Documented in get_anomer

#' Get the Anomeric information
#'
#' @param x A glycan structure vector or a glycan `igraph`.
#' @returns A character vector for structure-vector input, or a character scalar
#'   for graph input.
#' @export
#'
#' @examples
#' x <- n_glycan_core()
#' get_anomer(x)
get_anomer <- function(x) {
  if (inherits(x, "igraph")) {
    return(igraph::graph_attr(x, "anomer"))
  }
  smap_chr(x, function(g) g$anomer)
}

Try the glyrepr package in your browser

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

glyrepr documentation built on Sept. 22, 2026, 5:09 p.m.