
Enhance glycan structure
enhance_struc.RdGiven a glycan structure vector of any resolution level (see
glyrepr::get_structure_level() for details), this function gives compatible
structures with more specific residue identities or linkage information.
Arguments
- strucs
A
glyrepr::glycan_structure()vector, or a character vector of glycan structure strings supported byglyparse::auto_parse(). Inputs with unresolved floating parts or substituents are excluded with a warning.- db
A
glydb::glydb_structures()vector, or a character vector of glycan structure strings supported byglyparse::auto_parse(). Structures with unresolved floating parts or substituents are excluded with a warning. The default isglydb::glydb_structures()at "intact" level.- return_best
Logical. If
TRUE, only return the best matching structure (highest confidence) for each input structure.dbmust have aconfidenceattribute. 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.confidence: The database confidence score for each enhanced structure, orNAwhen no score is available. Note that onerawglycan structure can have differentenhancedstructures as multiple rows in the result.
Details
Input and database vectors may mix generic, concrete, and mixed residues, as well as topological, partial, and intact structures. Each database candidate is matched against each input independently.
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 × 3
#> raw enhanced confidence
#> <struct> <struct> <dbl>
#> 1 Gal(??-?)GalNAc(??- Gal(b1-3)GalNAc(a1- NA
#> 2 Gal(??-?)GalNAc(??- Gal(b1-4)GalNAc(a1- NA
# Refine generic residues without changing the structure level
db_topo <- "Gal(??-?)GalNAc(??-"
enhance_struc("Hex(??-?)HexNAc(??-", db = db_topo)
#> # A tibble: 1 × 3
#> raw enhanced confidence
#> <struct> <struct> <dbl>
#> 1 Hex(??-?)HexNAc(??- Gal(??-?)GalNAc(??- NA
# From partial level to intact level
enhance_struc("Gal(b1-?)GalNAc(a1-", db = db_intact)
#> # A tibble: 2 × 3
#> raw enhanced confidence
#> <struct> <struct> <dbl>
#> 1 Gal(b1-?)GalNAc(a1- Gal(b1-3)GalNAc(a1- NA
#> 2 Gal(b1-?)GalNAc(a1- Gal(b1-4)GalNAc(a1- NA