
Enhance glycan structure
enhance_struc.RdGiven a glycan structure vector 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().- db
A
glydb::glydb_structures()vector, or a character vector of glycan structure strings supported byglyparse::auto_parse(). If not provided, a default structure vector is loaded fromglydb::glydb_structures()at "intact" level. Ifdbhas a lower or equal resolution level thanstrucs, the result will be the same asstrucs(no enhancement).- 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
If return_best=TRUE:
An unnamed glyrepr::glycan_structure() vector with the same length as strucs.
Unmatched structures are returned as NA.
If return_best=FALSE:
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. 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-