Skip to contents

These functions are low-level variants of have_motif(), count_motif(), and match_motif() for package code that already has compatible igraph objects from glyrepr::get_structure_graphs().

Usage

.g_have_motif(
  glycan_graph,
  motif_graph,
  alignment = "substructure",
  ignore_linkages = FALSE,
  strict_sub = TRUE,
  match_degree = NULL
)

.g_count_motif(
  glycan_graph,
  motif_graph,
  alignment = "substructure",
  ignore_linkages = FALSE,
  strict_sub = TRUE,
  match_degree = NULL
)

.g_match_motif(
  glycan_graph,
  motif_graph,
  alignment = "substructure",
  ignore_linkages = FALSE,
  strict_sub = TRUE,
  match_degree = NULL
)

Arguments

glycan_graph

An igraph glycan graph.

motif_graph

An igraph motif graph.

alignment

A character scalar: "substructure", "core", "terminal", or "whole".

ignore_linkages

A logical scalar. If TRUE, linkages are ignored.

strict_sub

A logical scalar. If TRUE, substituents are matched strictly.

match_degree

A logical vector indicating which motif nodes must match the glycan's in- and out-degree exactly. A scalar is recycled to the number of motif nodes.

Value

  • .g_have_motif() returns a logical scalar.

  • .g_count_motif() returns an integer scalar.

  • .g_match_motif() returns a list of integer vectors.

Details

These functions do no validation, parsing, naming, or monosaccharide-type conversion. Callers must provide valid, already-compatible graph objects. In particular, when matching a generic motif graph, callers must pass a glycan graph whose mono vertex attributes have already been converted to the compatible generic representation.

These functions never call glyrepr::as_glycan_structure().