Provide an updated features, samples or measurements table to a tomic.

update_tomic(tomic, tomic_table)

Arguments

tomic

Either a tidy_omic or triple_omic object

tomic_table

A table taken from a tidy (i.e., augmented measurements) or triple omic dataset

Value

A tomic object with updated features, samples or measurements.

Examples


library(dplyr)
updated_features <- brauer_2008_triple$features %>%
  dplyr::filter(BP == "biological process unknown") %>%
  dplyr::mutate(chromosome = purrr::map_int(systematic_name, function(x) {
    which(LETTERS == stringr::str_match(x, "Y([A-Z])")[2])
  }))

update_tomic(brauer_2008_triple, updated_features)
#> $features
#> # A tibble: 110 × 5
#>    name    BP                         MF              systematic_name chromosome
#>    <chr>   <chr>                      <chr>           <chr>                <int>
#>  1 YOL029C biological process unknown molecular func… YOL029C                 15
#>  2 YHR036W biological process unknown molecular func… YHR036W                  8
#>  3 YAL046C biological process unknown molecular func… YAL046C                  1
#>  4 YHR151C biological process unknown molecular func… YHR151C                  8
#>  5 YKL027W biological process unknown molecular func… YKL027W                 11
#>  6 YBR220C biological process unknown molecular func… YBR220C                  2
#>  7 YLR057W biological process unknown molecular func… YLR057W                 12
#>  8 YDR239C biological process unknown molecular func… YDR239C                  4
#>  9 KKQ8    biological process unknown protein kinase… YKL168C                 11
#> 10 UIP5    biological process unknown molecular func… YKR044W                 11
#> # … with 100 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: 3,960 × 3
#>    name    sample expression
#>    <chr>   <chr>       <dbl>
#>  1 YOL029C G0.05       -0.22
#>  2 YHR036W G0.05       -0.91
#>  3 YAL046C G0.05        0.05
#>  4 YHR151C G0.05       -0.53
#>  5 YKL027W G0.05       -0.52
#>  6 YBR220C G0.05       -1.06
#>  7 YLR057W G0.05       -0.42
#>  8 YDR239C G0.05       -0.55
#>  9 KKQ8    G0.05       -0.6 
#> 10 UIP5    G0.05       -0.56
#> # … with 3,950 more rows
#> 
#> $design
#> $design$features
#> # A tibble: 5 × 2
#>   variable        type               
#>   <chr>           <chr>              
#> 1 name            feature_primary_key
#> 2 BP              character          
#> 3 MF              character          
#> 4 systematic_name character          
#> 5 chromosome      integer            
#> 
#> $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"