Skip to contents

This function simulates the action of enzymes on glycans. Think of it like a primordial soup where you put in a few glycans and enzymes, and let them interact to generate new glycans.

spawn_glycans_step() performs one round of enzyme action, while spawn_glycans() performs multiple rounds. The only difference between spawn_glycans_step() and spawn_glycans(n_steps = 1) is that the latter returns the original input glycans as well. For both, a vector of unique glycan structures is returned.

The number of glycans generated by spawn_glycans() is typically exponential, and can quickly become very large. Therefore, it is recommended to use a small number of steps and carefully select the enzymes. Also, you can use the filter argument to prune the results after each round.

Usage

spawn_glycans_step(glycans, enzymes)

spawn_glycans(glycans, enzymes, n_steps = 5, filter = NULL)

Arguments

glycans

A glyrepr::glycan_structure(), or a character vector of glycan structure strings supported by glyparse::auto_parse().

enzymes

A character vector of gene symbols, or a list of enzyme() objects.

n_steps

The maximum number of rounds to perform. The actual number of rounds may be less if no new glycans can be generated.

filter

A function to filter the generated glycans. It should have a single glyrepr::glycan_structure() vector as input, and return a logical vector of the same length. The function will be called on the results after each round.

Value

A glyrepr::glycan_structure() vector of all unique glycans generated.

Important notes

Here are some important notes for all functions in the glyenzy package.

Applicability

All algorithms and enzyme information in glyenzy are applicable only to humans, and specifically to N-glycans and O-GalNAc glycans. Results may be inaccurate for other types of glycans (e.g., GAGs, glycolipids) or for glycans in other species (e.g., plants, insects).

Inclusiveness

The algorithm takes an intentionally inclusive approach, assuming that all possible isoenzymes capable of catalyzing a given reaction may be involved. Therefore, results should be interpreted with caution.

For example, in humans, detection of the motif "Neu5Ac(a2-3)Gal(b1-" will return both "ST3GAL3" and "ST3GAL4". In reality, only one of them might be active, depending on factors such as tissue specificity.

Only "concrete" glycans

The function only works for glycans containing concrete residues (e.g., "Glc", "GalNAc"), and not for glycans with generic residues (e.g., "Hex", "HexNAc").

Substituents

Subtituents (e.g. sulfation, phosphorylation) is not supported yet, and the algorithms might fail for glycans with subtituents. If your glycans contains substituents, use glyrepr::remove_substituents() to get clean glycans.

Incomplete glycan structures

If the glycan structure is incomplete or partially degraded, the result may be misleading.

Starting points

Throughout glyenzy, the starting glycan is the Glc(3)Man(9)GlcNAc(2) precursor for N-glycans, and GalNAc(a1- for O-glycans. This means that enzymes involved in N-glycan precursor biosynthesis, mainly ALGs, and OST, which transfered the precursor to Asn, are not considered here. Similarly, GALNTs for O-glycans are not considered.

Examples

# Use `spawn_glycans_step()` to build glycans step by step
glycan <- "GlcNAc(b1-2)Man(a1-3)[Man(a1-6)]Man(b1-4)GlcNAc(b1-4)GlcNAc(b1-"
glycan |>
  spawn_glycans_step("MGAT2") |>
  spawn_glycans_step("B4GALT1") |>
  spawn_glycans_step("ST3GAL3")
#> <glycan_structure[2]>
#> [1] Neu5Ac(a2-3)Gal(b1-4)GlcNAc(b1-2)Man(a1-3)[GlcNAc(b1-2)Man(a1-6)]Man(b1-4)GlcNAc(b1-4)GlcNAc(b1-
#> [2] Neu5Ac(a2-3)Gal(b1-4)GlcNAc(b1-2)Man(a1-6)[GlcNAc(b1-2)Man(a1-3)]Man(b1-4)GlcNAc(b1-4)GlcNAc(b1-
#> # Unique structures: 2

# Use `spawn_glycans()` to simulate a primordial soup
glycans <- c(
  "GlcNAc(b1-2)Man(a1-3)[Man(a1-6)]Man(b1-4)GlcNAc(b1-4)GlcNAc(b1-",
  "GlcNAc(b1-2)Man(a1-3)[GlcNAc(b1-2)Man(a1-6)]Man(b1-4)GlcNAc(b1-4)GlcNAc(b1-"
)
enzymes <- c("B4GALT1", "ST3GAL3")
spawn_glycans(glycans, enzymes, n_steps = 5)
#> <glycan_structure[12]>
#> [1] GlcNAc(b1-2)Man(a1-3)[Man(a1-6)]Man(b1-4)GlcNAc(b1-4)GlcNAc(b1-
#> [2] GlcNAc(b1-2)Man(a1-3)[GlcNAc(b1-2)Man(a1-6)]Man(b1-4)GlcNAc(b1-4)GlcNAc(b1-
#> [3] Gal(b1-4)GlcNAc(b1-2)Man(a1-3)[Man(a1-6)]Man(b1-4)GlcNAc(b1-4)GlcNAc(b1-
#> [4] Gal(b1-4)GlcNAc(b1-2)Man(a1-3)[GlcNAc(b1-2)Man(a1-6)]Man(b1-4)GlcNAc(b1-4)GlcNAc(b1-
#> [5] Gal(b1-4)GlcNAc(b1-2)Man(a1-6)[GlcNAc(b1-2)Man(a1-3)]Man(b1-4)GlcNAc(b1-4)GlcNAc(b1-
#> [6] Gal(b1-4)GlcNAc(b1-2)Man(a1-3)[Gal(b1-4)GlcNAc(b1-2)Man(a1-6)]Man(b1-4)GlcNAc(b1-4)GlcNAc(b1-
#> [7] Neu5Ac(a2-3)Gal(b1-4)GlcNAc(b1-2)Man(a1-3)[Man(a1-6)]Man(b1-4)GlcNAc(b1-4)GlcNAc(b1-
#> [8] Neu5Ac(a2-3)Gal(b1-4)GlcNAc(b1-2)Man(a1-3)[GlcNAc(b1-2)Man(a1-6)]Man(b1-4)GlcNAc(b1-4)GlcNAc(b1-
#> [9] Neu5Ac(a2-3)Gal(b1-4)GlcNAc(b1-2)Man(a1-6)[GlcNAc(b1-2)Man(a1-3)]Man(b1-4)GlcNAc(b1-4)GlcNAc(b1-
#> [10] Neu5Ac(a2-3)Gal(b1-4)GlcNAc(b1-2)Man(a1-3)[Gal(b1-4)GlcNAc(b1-2)Man(a1-6)]Man(b1-4)GlcNAc(b1-4)GlcNAc(b1-
#> ... (2 more not shown)
#> # Unique structures: 12

# Use `filter` to prune the results after each round
# Here we keep only glycans that are synthesized by MGAT2
spawn_glycans(glycans, enzymes, n_steps = 5, filter = ~ is_synthesized_by(.x, "MGAT2"))
#> <glycan_structure[9]>
#> [1] GlcNAc(b1-2)Man(a1-3)[GlcNAc(b1-2)Man(a1-6)]Man(b1-4)GlcNAc(b1-4)GlcNAc(b1-
#> [2] Gal(b1-4)GlcNAc(b1-2)Man(a1-3)[GlcNAc(b1-2)Man(a1-6)]Man(b1-4)GlcNAc(b1-4)GlcNAc(b1-
#> [3] Gal(b1-4)GlcNAc(b1-2)Man(a1-6)[GlcNAc(b1-2)Man(a1-3)]Man(b1-4)GlcNAc(b1-4)GlcNAc(b1-
#> [4] Gal(b1-4)GlcNAc(b1-2)Man(a1-3)[Gal(b1-4)GlcNAc(b1-2)Man(a1-6)]Man(b1-4)GlcNAc(b1-4)GlcNAc(b1-
#> [5] Neu5Ac(a2-3)Gal(b1-4)GlcNAc(b1-2)Man(a1-3)[GlcNAc(b1-2)Man(a1-6)]Man(b1-4)GlcNAc(b1-4)GlcNAc(b1-
#> [6] Neu5Ac(a2-3)Gal(b1-4)GlcNAc(b1-2)Man(a1-6)[GlcNAc(b1-2)Man(a1-3)]Man(b1-4)GlcNAc(b1-4)GlcNAc(b1-
#> [7] Neu5Ac(a2-3)Gal(b1-4)GlcNAc(b1-2)Man(a1-3)[Gal(b1-4)GlcNAc(b1-2)Man(a1-6)]Man(b1-4)GlcNAc(b1-4)GlcNAc(b1-
#> [8] Neu5Ac(a2-3)Gal(b1-4)GlcNAc(b1-2)Man(a1-6)[Gal(b1-4)GlcNAc(b1-2)Man(a1-3)]Man(b1-4)GlcNAc(b1-4)GlcNAc(b1-
#> [9] Neu5Ac(a2-3)Gal(b1-4)GlcNAc(b1-2)Man(a1-3)[Neu5Ac(a2-3)Gal(b1-4)GlcNAc(b1-2)Man(a1-6)]Man(b1-4)GlcNAc(b1-4)GlcNAc(b1-
#> # Unique structures: 9