Skip to contents

Given 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.

Usage

enhance_struc(strucs, db = NULL, return_best = FALSE)

Arguments

strucs

A glyrepr::glycan_structure() vector, or a character vector of glycan structure strings supported by glyparse::auto_parse(). Glycan structures with level higher or same as the level of db will be returned as is. Glycan structures with level lower than the level of db will be enhanced to that level.

db

A glydb::glydb_structures() vector, or a character vector of glycan structure strings supported by glyparse::auto_parse(). All structures in db must be at the same resolution level. If not provided, a default structure vector is loaded from glydb::glydb_structures() at "intact" level.

return_best

Logical. If TRUE, only return the best matching structure (highest confidence) for each input structure. Requires db to have a confidence attribute. Use glydb::glydb_structures() for db to enable this feature. Default is FALSE.

Value

A tibble with the following columns:

  • raw: The original glycan structures.

  • enhanced: The enhanced glycan structures. Note that one raw glycan structure can have different enhanced glycan 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-