Simple helper function to convert a single assay data in a SummarizedExperiment object into a tidy tibble. If long = FALSE, a tibble with the same number of rows as the input SummarizedExperiment is constructed with columns corresponding to the columns of the SummarizedExperiment and any rowData. If long = TRUE, the assay data is "tidied" such that each row of the tibble corresponds to a single value of the assay. When long = TRUE, in addition to rowData, any colData is also added as additional columns.

# S3 method for SummarizedExperiment
tidy(x, assay = SummarizedExperiment::assayNames(x)[1], long = FALSE, ...)

Arguments

x

a SummarizedExperiment object.

assay

a numeric index or string name specifying the assay to tidy. If multiple assays are specified, assays will be combined as separate columns. (default = SummarizedExperiment::assayNames(x)[1])

long

a logical whether to transform data to long format and include colData in output rather than default wide format with dimension similar to original PBMExperiment object. Ignored and set to TRUE if assay specifies more than a single assay. (default = FALSE)

...

other parameters for the tidy generic function.

Value

tibble containing values from a single SummarizedExperiment assay along with rowData and optionally colData.