
Assign GlyTouCan accessions to glycan structures
struc_to_glytoucan.RdThis function takes a vector of glycan structures and returns the corresponding GlyTouCan accessions. It first looks up structures from glydb::glydb_data, then uses the GlycanFormatConverter API maintained by the Glycosmos project for structures not found locally.
Arguments
- strucs
A
glyrepr::glycan_structure()vector, or a character vector of glycan text representations supported byglyparse::auto_parse(). The glycan structure must have "concrete" monosaccharides (e.g., Gal, GalNAc). Inputs with unresolved floating parts or substituents produce a warning and returnNA.
Value
A character vector of GlyTouCan accessions corresponding to the input glycan structures.
If a structure cannot be converted to a GlyTouCan accession, the corresponding entry will be NA.
Details
For "topological" structures (e.g., "Gal(??-?)GalNAc(??-"),
this function will first call glyrepr::fill_anomer_pos() to fill in the missing
anomeric positions before looking up accessions. This is necessary because
all glycan structures in GlyTouCan must have defined anomeric positions.