Learn R Programming

glyrepr (version 0.10.1)

convert_to_generic: Convert Monosaccharides to Generic Type

Description

This function converts monosaccharide types of monosaccharide characters, glycan compositions, or glycan structures from concrete to generic type. This is a simplified version that only supports conversion from "concrete" to "generic" monosaccharides.

Usage

convert_to_generic(x)

# S3 method for character convert_to_generic(x)

# S3 method for glyrepr_structure convert_to_generic(x)

# S3 method for glyrepr_composition convert_to_generic(x)

Value

A new object of the same class as x

with monosaccharides converted to generic type.

Arguments

x

Either of these objects:

  • A character of monosaccharide;

  • A glycan composition vector ("glyrepr_composition" object);

  • A glycan structure vector ("glyrepr_structure" object).

Two types of monosaccharides

There are two types of monosaccharides:

  • concrete: e.g. "Gal", "GlcNAc", "Glc", "Fuc", etc.

  • generic: e.g. "Hex", "HexNAc", "HexA", "HexN", etc.

For the full list of monosaccharides, use available_monosaccharides().

Examples

Run this code
# Convert character vectors
convert_to_generic(c("Gal", "GlcNAc"))

# Convert glycan compositions
comps <- glycan_composition(
  c(Gal = 5, GlcNAc = 2),
  c(Glc = 5, GalNAc = 4, Fuc = 1)
)
convert_to_generic(comps)

# Convert glycan structures
strucs <- c(n_glycan_core(), o_glycan_core_1())
convert_to_generic(strucs)

Run the code above in your browser using DataLab