Skip to contents

These two functions provide a way to rename columns in the sample or variable information tibble of an experiment().

The same syntax as dplyr::rename() is used. For example, to rename the "group" column in the sample information tibble to "condition", use rename_obs(exp, condition = group). Note that you can't rename the "sample" column in the sample information tibble, as well as the "variable" column in the variable information tibble. These two columns are used to link the sample or variable information tibble to the expression matrix.

Usage

rename_obs(exp, ...)

rename_var(exp, ...)

Arguments

exp

An experiment().

...

<data-masking> Name pairs to rename. Use new_name = old_name to rename columns.

Value

An new experiment() object.

Examples

toy_exp <- toy_experiment
toy_exp
#> 
#> ── Glycoproteomics Experiment ──────────────────────────────────────────────────
#>  Expression matrix: 6 samples, 4 variables
#>  Sample information fields: group <chr>, batch <dbl>
#>  Variable information fields: protein <chr>, peptide <chr>, glycan_composition <chr>

# Rename columns in sample information tibble
rename_obs(toy_exp, condition = group)
#> 
#> ── Glycoproteomics Experiment ──────────────────────────────────────────────────
#>  Expression matrix: 6 samples, 4 variables
#>  Sample information fields: condition <chr>, batch <dbl>
#>  Variable information fields: protein <chr>, peptide <chr>, glycan_composition <chr>

# Rename columns in variable information tibble
rename_var(toy_exp, composition = glycan_composition)
#> 
#> ── Glycoproteomics Experiment ──────────────────────────────────────────────────
#>  Expression matrix: 6 samples, 4 variables
#>  Sample information fields: group <chr>, batch <dbl>
#>  Variable information fields: protein <chr>, peptide <chr>, composition <chr>