tidybulk() creates an annotated `tidybulk` tibble from a `tbl` (with at least three columns for sample, feature and transcript abundance) or `SummarizedExperiment` (more convenient if abstracted to tibble with library(tidySummarizedExperiment))

tidybulk(.data, .sample, .transcript, .abundance, .abundance_scaled = NULL)

# S4 method for class 'spec_tbl_df'
tidybulk(.data, .sample, .transcript, .abundance, .abundance_scaled = NULL)

# S4 method for class 'tbl_df'
tidybulk(.data, .sample, .transcript, .abundance, .abundance_scaled = NULL)

# S4 method for class 'SummarizedExperiment'
tidybulk(.data, .sample, .transcript, .abundance, .abundance_scaled = NULL)

# S4 method for class 'RangedSummarizedExperiment'
tidybulk(.data, .sample, .transcript, .abundance, .abundance_scaled = NULL)

Arguments

.data

A `tbl` (with at least three columns for sample, feature and transcript abundance) or `SummarizedExperiment` (more convenient if abstracted to tibble with library(tidySummarizedExperiment))

.sample

The name of the sample column

.transcript

The name of the transcript/gene column

.abundance

The name of the transcript/gene abundance column

.abundance_scaled

The name of the transcript/gene scaled abundance column

Value

A `tidybulk` object

A `tidybulk` object

A `tidybulk` object

A `tidybulk` object

A `tidybulk` object

Details

`r lifecycle::badge("maturing")`

This function creates a tidybulk object and is useful if you want to avoid to specify .sample, .transcript and .abundance arguments all the times. The tidybulk object have an attribute called internals where these three arguments are stored as metadata. They can be extracted as attr(<object>, "internals").

Examples


tidybulk(tidybulk::se_mini)
#> # A tibble: 2,635 × 9
#>    .feature .sample    count Cell.type time  condition  days  dead entrez
#>    <chr>    <chr>      <dbl> <chr>     <chr> <lgl>     <dbl> <dbl> <chr> 
#>  1 ABCB4    SRR1740034  1035 b_cell    0 d   TRUE          1     1 5244  
#>  2 ABCB9    SRR1740034    45 b_cell    0 d   TRUE          1     1 23457 
#>  3 ACAP1    SRR1740034  7151 b_cell    0 d   TRUE          1     1 9744  
#>  4 ACHE     SRR1740034     2 b_cell    0 d   TRUE          1     1 43    
#>  5 ACP5     SRR1740034  2278 b_cell    0 d   TRUE          1     1 54    
#>  6 ADAM28   SRR1740034 11156 b_cell    0 d   TRUE          1     1 10863 
#>  7 ADAMDEC1 SRR1740034    72 b_cell    0 d   TRUE          1     1 27299 
#>  8 ADAMTS3  SRR1740034     0 b_cell    0 d   TRUE          1     1 9508  
#>  9 ADRB2    SRR1740034   298 b_cell    0 d   TRUE          1     1 154   
#> 10 AIF1     SRR1740034     8 b_cell    0 d   TRUE          1     1 199   
#> # ℹ 2,625 more rows