
Reduce a Glycan Structure to a Lower Resolution Level
Source:R/structure-level.R
reduce_structure_level.RdThis function reduces a glycan structure from a higher resolution level to a lower resolution level
(see get_structure_level() for four possible levels of resolution).
For example, it can reduce an "intact" structure to a "topological" structure,
or a "partial" structure to a "basic" structure.
One exception is that you can never reduce an "intact" structure to "partial" level,
because the "partial" level is not deterministic.
Arguments
- x
A
glycan_structure()vector.- to_level
The resolution level to reduce to. Can be "basic" or "topological". Must be a lower resolution level than any structure in
x("intact" > "partial" > "topological" > "basic"). Ifto_levelis the same as some structure inx, the result will be the same as the input. You can useget_structure_level()to check the structure levels ofx.
Value
A glycan_structure() vector reduced to the given resolution level.
Details
The logic is as follows:
If
to_levelis "topological", this function callsremove_linkages()to remove all linkages.If
to_levelis "basic", this function callsremove_linkages()to remove all linkages, andconvert_to_generic()to convert all monosaccharides to generic.
Examples
glycan <- as_glycan_structure("Gal(b1-3)GalNAc(a1-")
reduce_structure_level(glycan, to_level = "topological")
#> <glycan_structure[1]>
#> [1] Gal(??-?)GalNAc(??-
#> # Unique structures: 1