glydraw 0.8.0
CRAN release: 2026-08-02
Breaking changes
- Cartoon appearance is now configured with
style = style_glydraw(...)acrossdraw_cartoon(),glycanGrob(),geom_glycan(),guide_glycan(),scale_x_glycan(),scale_y_glycan(),anno_glycan(), andexport_cartoons(); calls that passfuc_orient,edge_linewidth,node_linewidth,node_size,font_family, orcolorsdirectly should move those arguments intostyle_glydraw().show_linkageandorientremain explicit arguments and are no longer accepted bystyle_glydraw(), while explicitred_endoverrides the reusable style value. (#73, #79) -
colorsnow accepts a complete SNFG palette in the format returned byglydraw_colors(); sparse monosaccharide overrides are no longer supported. (#72) -
glydraw_style()has been renamed tostyle_glydraw()and is no longer exported; replace calls toglydraw_style()withstyle_glydraw(). (#73) -
orientno longer accepts"H"or"V"; calls using them now error and should replace"H"with"left"and"V"with"up". (#68) -
red_endinstyle_glydraw(),style_glygen(),style_snfg(), andstyle_glycoworkbench()must now be a string. Setred_end_length = 0to omit the reducing-end line and ignore anyred_endwave or custom text while retaining its axis-aligned core anomer annotation. Explicitred_end = NULLon drawing interfaces continues to inheritred_endfromstyle. (#80)
New features
-
anno_glycan()uses glycan cartoons as row or column labels in ComplexHeatmap heatmaps, with clustering-aware ordering and the sizing, anchoring, rotation, nudging, and styling controls of glycan axis scales. (#67) -
draw_cartoon_sketch()draws hand-sketched glycan cartoons with reproducible rough strokes, patterned residue fills, optional drawing media, and the same layout, annotation, orientation, highlighting, styling, sizing, and saving behavior asdraw_cartoon(). Sketch cartoons always use their handwriting font, ignoringfont_familyin style presets. (#77, #81) -
font_familystyle option controls the font used for text annotations across glycan cartoons, including alpha and beta anomer labels. (#69) -
geom_glycan()andgeom_node_glycan()gain analphaaesthetic. Each cartoon is composited before transparency is applied so nodes continue to occlude the linkage edges beneath them. Graphics devices without alpha-mask and transformation support throw an error for non-opaque values rather than render an inaccurate cartoon. (#85) - Glycan grobs used by
geom_glycan(),geom_node_glycan(),guide_glycan(),scale_x_glycan(), andscale_y_glycan()now remain vector graphics at every size when exported to PDF or SVG;draw_cartoon()and repeated panel structures also render more efficiently with native grid primitives without changing cartoon layout or appearance. (#64, #65, #66) -
orientnow accepts"left","right","up", and"down"to draw glycans in any direction. (#68) -
red_endnow accepts amino-acid sequences with one tagged glycosite, such as"ABC<site>D</site>EFG". The site is bold and anchored to the reducing end, and the sequence rotates with the glycan orientation. (#78, #82) -
red_end_lengthstyle option controls the length of the reducing-end line; at0, the line and allred_enddecorations are omitted while the axis-aligned core anomer annotation remains. (#80) -
red_end_sizestyle option controls the size of customred_endtext without changing the"~"wave. (#83) -
scale_x_glycan(),scale_y_glycan(), andanno_glycan()gain anorientargument. ItsNULLdefault automatically selects a drawing orientation from the displayed axis position or annotation side. Default justification follows compatible position-orientation combinations and centers other combinations. (#84) -
style_glydraw()is the reusable interface for tuning cartoon appearance; newstyle_glygen(),style_snfg(), andstyle_glycoworkbench()presets support common glycan-drawing conventions. (#73, #79)
Minor improvements and bug fixes
-
draw_cartoon()now rendersHexresidues as smooth, device-native circles across standalone cartoons and embedded glycan grobs. (#76) - Linkage annotations now move beta labels slightly away from horizontal and skewed edge lines while leaving labels beside vertical edges unchanged, including reducing-end annotations. (#70)
- Linkage-annotation collision handling now ignores the two labels belonging to the same edge, preventing enlarged nodes from unnecessarily reflecting an otherwise collision-free linkage. (#75)
-
style_glydraw(node_size = ...)now distributes linkage-annotation spacing adjustments across the node-to-label and label-to-label gaps, keeping linkage notation readable with enlarged nodes. (#74)
glydraw 0.7.0
CRAN release: 2026-07-25
This version of glydraw introduced some ggplot2 extensions.
New features
- New
glydraw_style()stores reusable glycan rendering options for standalone cartoons, grobs, export, ggplot2 layers, guides, and glycan scales. Explicit rendering arguments override the style. (#55) - New
geom_glycan()draws glycan cartoons for individual observations in ggplot2 plots, with support for size, rotation, justification, and cartoon appearance. - New
geom_node_glycan()draws glycan cartoons as nodes in ggraph network plots, with automatic node positioning and filtering support. (#61) - New
guide_glycan()displays glycan cartoons in ggplot2 legends. - New
scale_x_glycan()andscale_y_glycan()display glycan cartoons as discrete ggplot2 axis labels. - New
hjust_red_end()andvjust_red_end()anchor vertical and horizontal cartoons at their reducing ends ingeom_glycan(),scale_x_glycan(),scale_y_glycan(), andguide_glycan().guide_glycan()also gainshjustandvjustparameters. Reducing-end justification is the default for scale and guide cartoons along the axis perpendicular to their drawing orientation;geom_glycan()remains centered by default. (#54)
Minor improvements and bug fixes
-
draw_cartoon()now places double core Fuc branches on opposite sides of the core GlcNAc when linkage positions are unavailable, keeping both connections visible. (#59, #60) - Recognize bisecting GlcNAc from N-glycan topology when linkage information is unavailable, keeping it centered between the two mannose arms. (#58)
-
draw_cartoon()now treats genericdHexresidues as Fuc-like branches, using the same layout andfuc_orientbehavior as Fuc. (#56)
glydraw 0.6.2
Minor improvements and bug fixes
- Fix nested Fuc-like side-chain layout so xyloglucan-like branches preserve residue order and linkage annotations. (#51)
glydraw 0.6.0
Breaking changes
-
export_cartoons()no longer supportsglyexp::experiment()input, andglyexpis no longer a package dependency. (#33) - Specifying optional arguments in a positional manner is no longer supported. Please use
arg = valueinstead. (#40)
New features
- Add the
colorsparameter todraw_cartoon()andexport_cartoons()for customizing monosaccharide fill colors. (#44) - Add the
fuc_orientparameter todraw_cartoon()andexport_cartoons()for choosing whether Fuc triangles always point upward or flex toward their linkage direction. (#42) - Add the
scaleparameter tosave_cartoon()andexport_cartoons()for changing output pixel dimensions while preserving cartoon appearance. (#35) - Add the
node_sizeparameter todraw_cartoon()andexport_cartoons()for scaling residue cartoon sizes. Values larger than2are rejected because residues overlap. (#36) - Add the
edge_linewidthandnode_linewidthparameters todraw_cartoon()andexport_cartoons()for customizing linkage line and node border widths. (#34) - Add the
red_endparameter todraw_cartoon()andexport_cartoons()for custom reducing-end text or a wavy reducing-end annotation. (#31)
Minor improvements and bug fixes
- Fix substituent label alignment so horizontal labels are bottom-aligned and vertical labels are left-aligned. (#48)
- Extend Fuc-style branch layout and flexible orientation to additional Fuc-like residues. (#46)
- Fix
draw_cartoon()for structures with two core Fuc branches and one b1-4 GlcNAc branch, avoiding an igraph vertex-selection error and keeping the b1-4 GlcNAc aligned with the core GlcNAc. (#45) - Deprecate
dpiforsave_cartoon()andexport_cartoons()because glydraw uses an internal fixed design scale. Supplyingdpinow warns that the argument is ignored. (#35) - Keep substituent annotations visible when
show_linkage = FALSE. (#41) - Fix diagonal HexNAc linkage annotation offsets when
orient = "V". (#43) - Adjust linkage annotation offsets for diagonal HexNAc links. (#29)
glydraw 0.5.0
New features
- Use native ggplot2 theme to manage cartoon size, so
ggviewis no longer dependent. (#27)
glydraw 0.4.1
Minor improvements and bug fixes
- Fix substituent annotations in glycan cartoons. (#16)
- Fix reducing-end Fuc orientation in O-Fuc glycans. (#15)
- Make
export_cartoons()create the output directory when needed. (#17) - Make
export_cartoons()use vector names as output filenames when available. (#17)
glydraw 0.4.0
Breaking changes
- Remove the
mono_sizeparameter ofdraw_cartoon(). (9b05e6c)
New features
- Add a
highlightparameter todraw_cartoon(). (7e57a54, 3745ec8, c1057ba) - Add
export_cartoons()to save multiple glycan structure cartoons to files. (e1ac3c3)
Minor improvements and bug fixes
- Fix the bug that reducing end annotation was not shown with unknown anomer information. (#12)
- Fix the bug that glycans with only one monosaccharide could not be plotted. (#11)
- Fix the bug that “?” in linkages was not correctly handled. (#9)
- Fix the incorrect reducing end annotation direction in some situations. (#8)
- Fix the bug that glycan structures with multiple branches had incorrect layouts. (2ac4e9f)
- Fix the bug that “png” is not supported in
save_cartoon(). (fed89b9) - Fix the bug that structures with generic “NeuAc” and “NeuGc” cannot be plotted. (3b78303)
glydraw 0.3.0
Breaking changes
- Remove the
border_pxandpathparameters fromsave_cartoon().
Minor improvements and bug fixes
- Now we use
ggviewinstead ofggimagefor size fixing, which relies onrstudioapi::viewer()to display the plot. You might feel some difference in the display effect, but the SNFG itself keeps the same.
glydraw 0.2.0
Breaking changes
- Signature of
draw_cartoon()is changed intodraw_cartoon(structure, mono_size = 0.2, show_linkage = TRUE, orient = "H", ...)for better semantics.
New features
-
draw_cartoon()now prints fixed-size cartoon (sizes are calculated based on glycan structures) to the plot panel, to provide a unified behavior withsave_cartoon(). - Add reducing end annotation to the cartoons (including a short segment and the anomer of the reducing end residue).
Minor improvements and bug fixes
- Update default aesthetic settings:
- Make residue size larger.
- Adjust linkage annotation positions.
- Add a border to the plot panel.
- Fix the issue that some linkage annotations are truncated.
- Fix the bug that glycans with only one residue cannot be plotted by
draw_cartoon(). - Fix the bug that
pathparameter is mandatory insave_cartoon(). Now it is optional, to be in line withggplot2::ggsave(). - Update documentation of
save_cartoon()to differentiate it withggplot2::ggsave().
