glyrepr 1.1.0
New features
- New
canonicalize_glycan_graphs()validates and canonicalizes a batch of glycan graphs, returning aligned canonical graphs, IUPAC keys, statuses, and failure reasons while preserving source attributes. (#94) -
canonicalize_glycan_graphs()andstructure_from_arrays()support per-element recovery withon_failure = "na"; their warning conditions expose failed positions and reasons for programmatic handling. (#94) - New
structure_from_arrays()constructs glycan vectors directly from residue, edge, and floating-metadata records, preserving names and missing values while deduplicating canonical graphs. (#94)
Performance improvements
-
as_glycan_structure()converts IUPAC-condensed strings faster, including strings with modified residues or floating structures, while preservingon_failure = "error"andon_failure = "na"behavior. Source installation now requires Rcpp and a C++17 compiler. (#94) -
as_glycan_structure()andglycan_structure()construct vectors from graphs faster while preserving validation and canonical ordering;glycan_structure()also uses less temporary memory for large vectors. (#92)
Bug fixes
- Floating structure canonicalization now removes occupied candidate parents after singleton localization, preserving valid graphs and canonical-string round-trips. (#95)
glyrepr 1.0.0
CRAN release: 2026-08-22
Breaking changes
-
get_mono_type()now returns one value per structure or composition instead of one scalar for the whole vector and may return"mixed"; callers that assume a scalar result must handle aligned per-element values. Generic and concrete residues can now coexist within structures, compositions, and their vectors. (#90) - Structure levels now depend only on linkage and anomer information.
get_structure_level()returns one"intact","partial", or"topological"value per structure; the former"basic"level andreduce_structure_level()have been removed. Useremove_linkages()to remove linkage information andconvert_to_generic()to convert residue identities. (#90)
New features
- Generic and concrete residues can now coexist within structures, compositions, and their vectors; use aligned
get_mono_type()results to inspect each element. (#90) - Glycan structures now support alditols through reducing-end
-olIUPAC syntax, such asGal(b1-4)GlcNAc-ol(a1-. Newget_alditol()inspects the graph-level status, andstructure_from_tibbles()gains analditolsargument for lossless table round-trips; legacy graphs without the attribute remain non-alditols. (#88) - Concrete monosaccharides now support explicit unusual absolute configurations using a leading
D-orL-, such asD-Fuc,L-Gul, andD-Fucf; unprefixed names retain their natural configurations. (#85, #86) - Concrete monosaccharides now support explicit furanose forms such as
GalfandGlcfNAc; generic conversion remains unchanged, so these becomeHexandHexNAc, respectively. (#82) -
as_glycan_structure()andglycan_structure()now support floating glycan substructures with optional candidate-parent indices using{<floating>}and{<floating>|<parents>}syntax. Floating structures retain component-node and candidate-parent metadata through validation, canonicalization, transformations, and graph-table round-trips. (#80) -
as_glycan_structure()andglycan_structure()now support floating substituents with unresolved parent residues using{<substituent>}and{<substituent>|<parents>}syntax, including unknown carbon positions such as{?S}. (#87) - Floating candidate-parent indices follow complete IUPAC-condensed residue order. Floating parts may attach to other floating components or the main tree, floating substituents may target any residue node, and localization retains only conflict-free acyclic assignments that connect every component to the main tree. (#89)
- New
enumerate_floating_graph_localizations()andenumerate_floating_localizations()return conflict-free floating-part and floating-substituent assignments with provenance, whilelocalize_floating_parts()attaches selected floating parts; graph-level results retain original vertex IDs, anddeduplicate = FALSEretains assignments that canonicalize to the same structure. (#80) -
print()gains annargument forglyrepr_structureandglyrepr_compositionvectors. (#77) - New
structure_candidate_edges(),structure_component_membership(), andstructure_floating_candidates()helpers expose floating-part membership and virtual edges plus floating-part and floating-substituent candidate parents for inspection, drawing, and constraint-aware graph operations. (#80) - Structure inspection, transformation, graph-table, composition, and IUPAC APIs now accept individual glycan
igraphobjects directly while preserving existingglyrepr_structurevector behavior and vertex IDs. (#81)
Minor improvements and fixes
-
as_glycan_structure()andglycan_structure()now support ambiguous substituent positions such asGal4/6S(a1-and preserve them during graph and IUPAC conversion. (#84) -
as_glycan_structure()now accepts omitted reducing-end annotations by inferring the anomer position, normalizes(?-?)to(??-?), and collapses linkage-position choices containing?to a single unknown position. (#83) -
get_structure_level()treats floating candidate-parent ambiguity independently from linkage resolution; fully specified floating structures can be intact. (#80) - IUPAC-condensed sequence generation from glycan graphs is now faster. (#78)
-
validate_glycan_graph()andas_glycan_structure()are faster through bulk linkage-position validation. (#79)
glyrepr 0.14.0
CRAN release: 2026-07-21
New features
- The low-level
validate_glycan_graph(),canonicalize_glycan_graph(),validate_glycan_graph_vector(),graph_to_iupac(), andnew_glycan_structure()APIs support name-preserving construction from trusted glycan graphs. (#75)
Minor improvements and bug fixes
- Glycan structures now allow multiple substituents with unknown positions. (#67)
-
as_glycan_structure()gainson_failure = "na"to preserve valid elements, replace element-local failures withNA, and report one aggregated warning. (#73) -
convert_to_generic()now converts concrete monosaccharides in mixed concrete/generic character vectors. (#68) -
fill_anomer_pos()now accepts glycan structures with generic monosaccharides. (#70)
glyrepr 0.13.0
CRAN release: 2026-07-05
New features
- Add
structure_nodes(),structure_edges(), andstructure_from_tibbles()for converting glycan structures to and from graph-table tibbles. (#60) - Rename
get_anomer_pos()toinfer_anomer_pos()to better describe that the position is inferred from a monosaccharide name;get_anomer_pos()remains available as a backward-compatible alias. (#61) -
get_anomer_pos()now accepts generic monosaccharide names such as"Hex". (#57) - Add
NGcandGcto the supported substituent list for N-glycolyl and glycolyl substituents. (#54) - Add
as.list()support forglyrepr_compositionandglyrepr_structurevectors. (#52)
Minor improvements and bug fixes
-
glyrepr_structureobjects no longer returnTRUEfromis.character(). Useas.character()for explicit IUPAC-condensed string conversion. (#59) - Fix
as_glycan_structure()so character vectors containingNAreject mixed concrete and generic structures consistently. (#58) - Fix
as_glycan_structure()parsing for monosaccharide names that start with digits, such as6dGuland4eLeg. (#55) - Fix
as_glycan_structure()parsing for substituent names such asPyr,PC,PPEtn, andPEtnthat share thePprefix. (#53) - Ambiguous linkages like
a2-3/6are also regarded as unknown forhas_linkage()andget_structure_level(). (#51)
glyrepr 0.12.1
CRAN release: 2026-06-19
Minor improvements and bug fixes
- Performance optimization for glycan structure vector creation. (#46)
glyrepr 0.12.0
CRAN release: 2026-05-14
New features
- Add
get_anomer_pos()helper to get the anomer position of a monosaccharide. - Add
fill_anomer_pos()function to fill the anomer position of a glycan structure with missing anomer information.
glyrepr 0.11.0
CRAN release: 2026-04-26
Breaking changes
-
get_structure_level()now returns one character scalar for aglyrepr_structurevector instead of one value per element. The vector-wide level is “intact”, “partial”, “topological”, or “basic” according to the combined residue and linkage detail of the non-missing structures in the vector (#42).
New features
-
as_glycan_composition()now supports parsing “E” and “L” in the input composition strings as “NeuAc”. For example,as_glycan_composition("H5N4F1L1E1")is now correctly parsed asHex(5)HexNAc(4)Fuc(1)NeuAc(2), with a warning about dropping the sialic acid linkage information (#41).
Minor improvements and bug fixes
- Fix the bug that
glycan_composition()andas_glycan_composition()cannot handle duplications in the input. For example,as_glycan_composition("Hex(2)Hex(1)HexNAc(2)")is correctly regared asHex(3)HexNAc(2)now (#40). -
as_glycan_structure(NA_character_)now creates a missing structure instead of erroring. -
get_structure_level()now ignores missing structures when determining the vector-wide level, and returnsNA_character_for empty or all-missing structure vectors. -
reduce_structure_level()preserves missing structures in output. -
simap()and `simap_structure()now skip missing structures like the other smap variants. -
get_mono_type.glyrepr_composition()now ignores missing composition elements and returnsNA_character_for all-NA composition vectors. - Rewrite the Getting Started vignette for better readability and adopt a calmer tone for all vignettes.
glyrepr 0.10.1
CRAN release: 2026-02-13
Minor improvements and bug fixes
- Use
dplyr::recode_values()to replace deprecateddplyr::case_match()to prevent warnings fromdplyr.
glyrepr 0.10.0
CRAN release: 2026-01-24
We have redesigned the internal implementation of glyrepr_composition and glyrepr_structure. This brought native support for names to glyrepr_structure, and NA values to both glyrepr_structure and glyrepr_composition.
New features
-
smap(),smap2(),spmap(),simap()and their variants now preserve names from inputglyrepr_structurevectors in their output. -
glyrepr_structurenow formally supports names. All operations on a namedglyrepr_structurevectors preserve the names. - NA values are supported for
glyrepr_structureandglyrepr_composition. Any operation on aglyrepr_structureorglyrepr_compositionvector with NA values behave intuitively.is.na()now works for these two classes. -
glycan_composition()now accepts anotherglyrepr_compositionvector as input, returning it as-is.
Breaking changes
-
glyrepr_compositionandglyrepr_structurenow enforce the same monosaccharide type (“concrete” or “generic”) within a vector. Mixed types are not allowed anymore. This invariant is enforced both when creating new vectors and when combining existing vectors. -
glycan_structure()now does not support multipleglyrepr_structurevectors as input anymore. For example,glycan_structure(o_glycan_core_1(), o_glycan_core_2())is not valid anymore. Please usec(o_glycan_core_1(), o_glycan_core_2())instead. -
get_mono_type()now returns a character scalar instead of a character vector forglyrepr_structureandglyrepr_composition.
glyrepr 0.9.0
CRAN release: 2025-11-23
New features
- Update the monosaccharides table, ensuring all monosaccharides having generic names:
- Add generic monosaccharides to Ara, Lyx, Xyl, Rib, Api, Neu, Kdn, Pse, Leg, Aci, 4eLeg, Bac, LDmanHep, DDmanHep, Kdo, Dha, MurNAc, MurNGc, Mur, Fru, Tag, Sor, Psi.
- Rename “Pent” to “Pen”.
- Delete “Sia” from the table.
-
count_mono()now supports counting substituents, with a new argumentinclude_subs. - Add
reduce_structure_level()to reduce a glycan structure to a lower resolution level.
Minor improvements and bug fixes
- Fix the bug that
convert_to_generic()fails with glycan compositions containing substituents. - Fix the bug that
has_linkages()didn’t consider reducing end anomers, which influenced the results ofget_structure_level().
glyrepr 0.8.0
CRAN release: 2025-11-09
Breaking changes
- Remove
normalize_substituents(). This function does not help outside ofglyreprso we make it an internal function. -
glycan_composition()cannot accept empty integer vectors now. Therefore,glycan_composition(integer(0))is not valid anymore. -
glycan_composition()now checks input types more strictly. -
as_glycan_composition()handles NA values and empty strings (““) more strictly. Now an error will be raised if NA values or empty strings are passed instead of dropping them silently. This update makesas_glycan_composition()size-stable and consistent withas_glycan_structure().
New features
- Add
get_structure_level()to get the structure resolution levels of a glycan structure vector. -
as_glycan_composition()now supports simple composition strings like “H5N2”, “H5N4F1S2”, “H5N4A1G1”, etc. -
count_mono()now returns total number of monosaccharides whenmonoisNULL. -
has_linkages()now has astrictparameter to control the strictness of the check.
Minor improvements and bug fixes
-
glycan_composition()now supports!!!. - Add more examples about character strings in the documentation of
as_glycan_composition(). - Add a section about structure resolution levels in the getting started vignette.
glyrepr 0.7.4
CRAN release: 2025-09-23
Minor improvements and bug fixes
- Update package title and description.
- Remove parallel examples in
smap().
glyrepr 0.7.2
Minor improvements and bug fixes
- Fix the bug that
structure_to_iupac()returns incorrect sequences with incorrect backbone or branch order.
glyrepr 0.7.1
Minor improvements and bug fixes
- Fix the bug that
smap2(),spmap(), and related functions return unexpected results when the inputyis a list. - Improve the documentation of
glycan_structure(), including the new behavior of vertex and edge order introduced in 0.7.0.
glyrepr 0.7.0
Breaking changes
-
convert_mono_type()is now replaced byconvert_to_generic().convert_mono_type()was created when three monosaccharide types existed: “concrete”, “generic”, and “simple”. When “simple” was removed, the oldconvert_mono_type()seems redundant, as the only valid conversion is from “concrete” to “generic” now. Therefore, we remove this function now and add a more straightforwardconvert_to_generic(). -
get_structure_graphs()is redesigned.- The
iparameter is removed, as indexing can be done manually on the inputglyrepr_structurevector or on the returned list easily. - Add a
return_listparameter to control the return type. This parameter makes this function “type-stable”.
- The
-
glycan_structure()andas_glycan_structure()now reorder the underlying graphs to be in line with the IUPAC-style sequence. For example, the vertex order of “Gal(b1-3)[GlcNAc(b1-6)]GalNAc(b1-” is always 1. Gal, 2. GlcNAc, 3. GalNAc, and edges b1-3, b1-6, no matter what the original graphs are. Users can assign the indices of vertices and edges easily by printing the structure to console. This update makesglymotif::match_motif()more meaningful.
Minor improvements and bug fixes
- Fix the bug that monosaccharides with substituents are not colored when a
glycan_structure()is printed in the console. For example, the “Neu5Ac” part in “Neu5Ac9Ac(a2-” was printed in black. Now it is printed in purple, while the “9Ac” part remains in black. - Fix the bug that Neu5Ac and Neu5Gc with substituents at position 2, 3, or 4 could not be correctly parsed. Now, complex patterns like “Neu4Ac5Ac9Ac” can be properly handled, into a “Neu5Ac” monosaccharide with “4Ac,9Ac” as substituents.
glyrepr 0.6.1
Minor improvements and bug fixes
-
n_glycan_core()now has a “b1” reducing end anomer, not “?1”. - Add validation to
glycan_structure()to ensure no duplicated linkage positions. For example, “Gal(b1-3)[Fuc(a1-3)]GalNAc(b1-” is invalid now becuase both “Gal” and “Fuc” are linked to “GalNAc” at position 3. - Add descriptions about ambiguous linkages and anomers in
glycan_structure()documentation. -
remove_linkages()now also removes reducing end anomers. -
n_glycan_core(),o_glycan_core_1(), ando_glycan_core_2()now have “??” anomers whenlinkage = FALSE. - Fix a bug in
smap_structure(),smap2_structure(),spmap_structure(), andsimap_structure()where modifying the structures can create identical structures, but the unique structures are not updated correctly. This automatically fixes a similar bug inremove_linkages().
glyrepr 0.6.0
Breaking changes
- Remove the “alditol” attribute from
glycan_structure()objects. This information is rarely used in glycomics and glycoproteomics data analysis. It is removed according to the razor principle. -
as_glycan_structure()now doesn’t allow the input IUPAC-condensed strings to omit the anomer information. Previously, something like “Glc(a1-3)GlcNAc” is valid.as_glycan_structure()assumed that the core “GlcNAc” has a “?1-” anomer and added it automatically. The problem is that this behavior was not easily awared by users and might cause confusion. Again, less is more, so we remove it.
glyrepr 0.5.0
Major changes
- Glycan structures now support multiple substituents on a single monosaccharide. Substituents are stored as comma-separated strings internally and concatenated in IUPAC format for display.
- Glycan compositions now support substituents. The
glycan_compositionclass can now represent and count substituents alongside monosaccharides.
