
Enhance glycan structure
enhance_struc.RdGiven a glycan structure of any resolution level (see glyrepr::get_structure_level() for details),
this function gives all possible glycan structures of higher resolution level.
Arguments
- strucs
A
glyrepr::glycan_structure()vector, or a character vector of glycan structure strings supported byglyparse::auto_parse(). Glycan structures with level higher or same as the level ofdbwill be returned as is. Glycan structures with level lower than the level ofdbwill be enhanced to that level.- db
A
glydb::glydb_structures()vector, or a character vector of glycan structure strings supported byglyparse::auto_parse(). All structures indbmust be at the same resolution level. If not provided, a default structure vector is loaded fromglydb::glydb_structures()at "intact" level.- return_best
Logical. If
TRUE, only return the best matching structure (highest confidence) for each input structure. Requiresdbto have aconfidenceattribute. Useglydb::glydb_structures()fordbto enable this feature. Default isFALSE.
Value
A tibble with the following columns:
raw: The original glycan structures.enhanced: The enhanced glycan structures. Note that onerawglycan structure can have differentenhancedglycan structures as multiple rows in the result.
Details
The target resolution level is determined from db. All structures in db must be at the same level.
When db is NULL, the default glydb::glydb_structures() at "intact" level is used.
Examples
# From topological level to intact level
db_intact <- c("Gal(b1-3)GalNAc(a1-", "Gal(b1-4)GalNAc(a1-")
enhance_struc("Gal(??-?)GalNAc(??-", db = db_intact)
#> # A tibble: 2 × 2
#> raw enhanced
#> <struct> <struct>
#> 1 Gal(??-?)GalNAc(??- Gal(b1-3)GalNAc(a1-
#> 2 Gal(??-?)GalNAc(??- Gal(b1-4)GalNAc(a1-
# From basic level to topological level
db_topo <- "Gal(??-?)GalNAc(??-"
enhance_struc("Hex(??-?)HexNAc(??-", db = db_topo)
#> # A tibble: 1 × 2
#> raw enhanced
#> <struct> <struct>
#> 1 Hex(??-?)HexNAc(??- Gal(??-?)GalNAc(??-
# From partial level to intact level
enhance_struc("Gal(b1-?)GalNAc(a1-", db = db_intact)
#> # A tibble: 2 × 2
#> raw enhanced
#> <struct> <struct>
#> 1 Gal(b1-?)GalNAc(a1- Gal(b1-3)GalNAc(a1-
#> 2 Gal(b1-?)GalNAc(a1- Gal(b1-4)GalNAc(a1-