Provides a tidy data framework for managing glycoproteomics and glycomics experimental data. The core feature is the βexperiment()β class, which serves as a unified data container integrating expression matrices, variable information (proteins, peptides, glycan compositions, etc.), and sample metadata (groups, batches, clinical variables, etc.). The package enforces data consistency, validates column types according to experiment types (glycomics, glycoproteomics, traitomics, traitproteomics), and provides dplyr-style data manipulation functions (filter, mutate, select, arrange, slice, join) for seamless data wrangling.
Installation
Install glycoverse
We recommend installing the meta-package glycoverse, which includes this package and other core glycoverse packages.
Install glyexp alone
If you donβt want to install all glycoverse packages, you can only install glyexp.
You can install the latest release of glyexp from r-universe (recommended):
# install.packages("pak")
pak::repo_add(glycoverse = "https://glycoverse.r-universe.dev")
pak::pkg_install("glyexp")Or from GitHub:
pak::pkg_install("glycoverse/glyexp@*release")Or install the development version (NOT recommended):
pak::pkg_install("glycoverse/glyexp")Note: Tips and troubleshooting for the meta-package glycoverse are also applicable here: Installation of glycoverse.
Role in glycoverse
The experiment() class provides a consistent interface for glycoprotemics and glycomics data. All other packages in the glycoverse ecosystem know how to extract information from an experiment() object. So, put your data in an experiment() object and pass it around. Let other packages do the heavy lifting.
Example
library(glyexp)
# Create a toy experiment
a_little_toy <- toy_experiment
a_little_toy
#>
#> ββ Others Experiment βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
#> βΉ Expression matrix: 6 samples, 4 variables
#> βΉ Sample information fields: group <chr>, batch <dbl>
#> βΉ Variable information fields: protein <chr>, peptide <chr>, glycan_composition <chr>
get_expr_mat(a_little_toy)
#> S1 S2 S3 S4 S5 S6
#> V1 1 5 9 13 17 21
#> V2 2 6 10 14 18 22
#> V3 3 7 11 15 19 23
#> V4 4 8 12 16 20 24
get_sample_info(a_little_toy)
#> # A tibble: 6 Γ 3
#> sample group batch
#> <chr> <chr> <dbl>
#> 1 S1 A 1
#> 2 S2 A 2
#> 3 S3 A 1
#> 4 S4 B 2
#> 5 S5 B 1
#> 6 S6 B 2
get_var_info(a_little_toy)
#> # A tibble: 4 Γ 4
#> variable protein peptide glycan_composition
#> <chr> <chr> <chr> <chr>
#> 1 V1 PRO1 PEP1 H5N2
#> 2 V2 PRO2 PEP2 H5N2
#> 3 V3 PRO3 PEP3 H3N2
#> 4 V4 PRO3 PEP4 H3N2
# Filter samples
a_little_toy |>
filter_obs(group == "A") |>
filter_var(protein == "PRO1")
#>
#> ββ Others Experiment βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
#> βΉ Expression matrix: 3 samples, 1 variables
#> βΉ Sample information fields: group <chr>, batch <dbl>
#> βΉ Variable information fields: protein <chr>, peptide <chr>, glycan_composition <chr>