Visualize where a motif matches a glycan structure.
Usage
view_motif(
glycan,
motif,
alignment = NULL,
ignore_linkages = FALSE,
strict_sub = TRUE,
match_degree = NULL
)Arguments
- glycan
One of:
A scalar
glyrepr::glycan_structure().A glycan structure string. All formats supported by
glyparse::auto_parse()are accepted, including IUPAC-condensed, WURCS, GlycoCT, and others.
- motif
One of:
A
glyrepr::glycan_structure()scalar.A glycan structure string, supported by
glyparse::auto_parse().A known motif name (use
db_motifs()to see all available motifs).
- alignment
A character string. Possible values are "substructure", "core", "terminal", and "whole". If not provided, the value will be decided based on the
motifargument. Ifmotifis a motif name, the alignment in the database will be used. Otherwise, "substructure" will be used.- ignore_linkages
A logical value. If
TRUE, linkages will be ignored in the comparison. Default isFALSE.- strict_sub
A logical value. If
TRUE(default), substituents will be matched in strict mode, which means if the glycan has a substituent in some residue, the motif must have the same substituent to be matched.- match_degree
A logical vector indicating which motif nodes must match the glycan's in- and out-degree exactly. For
have_motif(),count_motif(), andmatch_motif(), this must be a logical vector with length 1 or the number of motif nodes (length 1 is recycled). Forhave_motifs(),count_motifs(), andmatch_motifs(), this must be a list of logical vectors with length equal tomotifs; each element follows the same length rules. Whenmatch_degreeis provided,alignmentandalignmentsare silently ignored.
Value
A ggplot object returned by glydraw::draw_cartoon(). If no match is found,
the glycan is drawn without highlighted residues and a cli alert is emitted.
Details
view_motif() matches one motif against one glycan with the same
matching rules used by match_motif(), then draws the glycan with the
matched residues highlighted.
Examples
library(glyparse)
library(glyrepr)
glycan <- n_glycan_core()
motif <- parse_iupac_condensed("Man(a1-3)[Man(a1-6)]Man(b1-")
if (FALSE) { # \dontrun{
view_motif(glycan, motif)
} # }
