
Convert SummarizedExperiment to experiment
from_se.Rd
Convert a SummarizedExperiment
object to an experiment()
object.
This function maps the SummarizedExperiment structure to experiment format:
The main assay becomes
expr_mat
colData
becomessample_info
rowData
becomesvar_info
metadata
becomesmeta_data
Arguments
- se
A
SummarizedExperiment
object to convert.- assay_name
Character string specifying which assay to use. If NULL (default), uses the first assay.
- exp_type
Character string specifying experiment type. Must be either "glycomics" or "glycoproteomics". If NULL, will try to extract from metadata, otherwise defaults to "glycomics".
- glycan_type
Character string specifying glycan type. Must be either "N" or "O". If NULL, will try to extract from metadata, otherwise defaults to "N".
Value
An experiment()
object.
Examples
# Convert SummarizedExperiment back to experiment
se <- as_se(toy_experiment)
exp_back <- from_se(se, exp_type = "glycomics", glycan_type = "N")
exp_back
#>
#> ── Glycomics Experiment ────────────────────────────────────────────────────────
#> ℹ Expression matrix: 6 samples, 4 variables
#> ℹ Sample information fields: group <chr>, batch <dbl>
#> ℹ Variable information fields: protein <chr>, peptide <chr>, glycan_composition <chr>