Pivot a selected omics dataset from a MultiAssayExperiment into tidybulk format
Source:R/pivot_exp.R
pivot_exp.RdExtracts a specified omics dataset from a MultiAssayExperiment,
optionally filters by feature (row) names,
and returns a tidy tibble. The output includes assay values along with
sample metadata and feature metadata.
Value
A tibble in tidy format with one row per feature/sample pair,
including all metadata and a new column exp_name
indicating the assay source. Assay values are provided in separate columns
named after the assay slot(s).
Examples
# create example data
mae <- make_example_data(
n_samples = 10,
return_mae = TRUE
)
#> Ensuring all omics datasets are matrices with column names.
#> Creating SummarizedExperiment objects.
#> Creating MultiAssayExperiment object.
#> MultiAssayExperiment created successfully.
# pivot experiment
exp_data <- pivot_exp(
exposomicset = mae,
exp_name = "mRNA",
features = c("feat_42")
)