as_SummarizedExperiment() creates a `SummarizedExperiment` object from a `tbl` or `tidybulk` tbl formatted as | <SAMPLE> | <TRANSCRIPT> | <COUNT> | <...> |
as_SummarizedExperiment(
.data,
.sample = NULL,
.transcript = NULL,
.abundance = NULL
)
# S4 method for class 'tbl_df'
as_SummarizedExperiment(
.data,
.sample = NULL,
.transcript = NULL,
.abundance = NULL
)
A `SummarizedExperiment` object
A `SummarizedExperiment` object
Mangiola, S., Molania, R., Dong, R., Doyle, M. A., & Papenfuss, A. T. (2021). tidybulk: an R tidy framework for modular transcriptomic data analysis. Genome Biology, 22(1), 42. doi:10.1186/s13059-020-02233-7
Lawrence, M., Huber, W., Pagès, H., Aboyoun, P., Carlson, M., Gentleman, R., Morgan, M. T., & Carey, V. J. (2013). Software for computing and annotating genomic ranges. PLoS Computational Biology, 9(8), e1003118. doi:10.1371/journal.pcbi.1003118
Wickham, H., François, R., Henry, L., Müller, K., & Vaughan, D. (2023). dplyr: A Grammar of Data Manipulation. R package version 1.1.0. https://CRAN.R-project.org/package=dplyr
# Convert tibble to SummarizedExperiment
library(tibble)
tibble(.sample = "A", .transcript = "CD3G", count = 1) |>
as_SummarizedExperiment(.sample = .sample, .transcript = .transcript, .abundance = count)
#> # A SummarizedExperiment-tibble abstraction: 1 × 5
#> # Features=1 | Samples=1 | Assays=count
#> .feature .sample count.x count.y .transcript
#> <chr> <chr> <dbl> <dbl> <chr>
#> 1 CD3G A 1 1 CD3G