Convert a tidy_omic object into a triple_omic object.

tidy_to_triple(tidy_omic)

Arguments

tidy_omic

an object of class tidy_omic produced by create_tidy_omic

Value

A triple_omic object as created by create_triple_omic

Details

The data table will be converted into features, samples, and measurements tables using the design to determine which variables belong in each table. The design will be preserved as-is.

Examples

tidy_to_triple(brauer_2008_tidy)
#> $features
#> # A tibble: 500 × 4
#>    name    BP                            MF                      systematic_name
#>    <chr>   <chr>                         <chr>                   <chr>          
#>  1 YOL029C biological process unknown    molecular function unk… YOL029C        
#>  2 SCW11   cytokinesis, completion of s… glucan 1,3-beta-glucos… YGL028C        
#>  3 YHR036W biological process unknown    molecular function unk… YHR036W        
#>  4 BGL2    cell wall organization and b… glucan 1,3-beta-glucos… YGR282C        
#>  5 ACT1    cell wall organization and b… structural constituent… YFL039C        
#>  6 FKH1    pseudohyphal growth*          transcription factor a… YIL131C        
#>  7 HOC1    cell wall mannoprotein biosy… transferase activity, … YJR075W        
#>  8 CSN12   adaptation to pheromone duri… molecular function unk… YJR084W        
#>  9 YAL046C biological process unknown    molecular function unk… YAL046C        
#> 10 SLG1    cell wall organization and b… transmembrane receptor… YOR008C        
#> # … with 490 more rows
#> 
#> $samples
#> # A tibble: 36 × 3
#>    sample nutrient    DR
#>    <chr>  <chr>    <dbl>
#>  1 G0.05  G         0.05
#>  2 G0.1   G         0.1 
#>  3 G0.15  G         0.15
#>  4 G0.2   G         0.2 
#>  5 G0.25  G         0.25
#>  6 G0.3   G         0.3 
#>  7 N0.05  N         0.05
#>  8 N0.1   N         0.1 
#>  9 N0.15  N         0.15
#> 10 N0.2   N         0.2 
#> # … with 26 more rows
#> 
#> $measurements
#> # A tibble: 18,000 × 3
#>    name    sample expression
#>    <chr>   <chr>       <dbl>
#>  1 YOL029C G0.05       -0.22
#>  2 SCW11   G0.05       -0.67
#>  3 YHR036W G0.05       -0.91
#>  4 BGL2    G0.05       -0.08
#>  5 ACT1    G0.05       -0.04
#>  6 FKH1    G0.05       -0.57
#>  7 HOC1    G0.05       -0.42
#>  8 CSN12   G0.05       -0.49
#>  9 YAL046C G0.05        0.05
#> 10 SLG1    G0.05       -0.06
#> # … with 17,990 more rows
#> 
#> $design
#> $design$features
#> # A tibble: 4 × 2
#>   variable        type               
#>   <chr>           <chr>              
#> 1 name            feature_primary_key
#> 2 systematic_name character          
#> 3 BP              character          
#> 4 MF              character          
#> 
#> $design$samples
#> # A tibble: 3 × 2
#>   variable type              
#>   <chr>    <chr>             
#> 1 sample   sample_primary_key
#> 2 nutrient character         
#> 3 DR       numeric           
#> 
#> $design$measurements
#> # A tibble: 3 × 2
#>   variable   type               
#>   <chr>      <chr>              
#> 1 name       feature_primary_key
#> 2 sample     sample_primary_key 
#> 3 expression numeric            
#> 
#> $design$feature_pk
#> [1] "name"
#> 
#> $design$sample_pk
#> [1] "sample"
#> 
#> 
#> attr(,"class")
#> [1] "triple_omic" "tomic"       "general"