Merge a table of sample metadata with an existing mzroll_list

merge_samples_tbl(mzroll_list, samples_tbl, id_strings, exact = TRUE)

Arguments

mzroll_list

output of process_mzroll or process_mzroll_multi

  • features: one row per unique analyte (defined by a unique groupId),

  • samples: one row per unique sample (defined by a unique sampleId),

  • measurements: one row per peak (samples x peakgroups)

samples_tbl

Table of sample metadata

id_strings

one or more variables which will be used to match sample names.

exact

if true, an exact match between mzroll names and id_strings will be found; if false, then substring matches will be used.

Examples

mzroll_list <- process_mzroll(nplug_mzroll()) merge_samples_tbl(mzroll_list, nplug_samples, "sample_name")
#> $features #> # A tibble: 106 × 12 #> groupId compoundName smiles adductName tagString mz rt compoundDB #> <fct> <chr> <chr> <chr> <chr> <dbl> <dbl> <chr> #> 1 1 Ribose-P NA NA "" NA NA NA #> 2 2 OMP NA NA "" NA NA NA #> 3 3 1,3-diphopshategl… NA NA "" NA NA NA #> 4 4 3-hydroxy-3-methy… NA NA "" NA NA NA #> 5 5 3-phosphoglycerate NA NA "" NA NA NA #> 6 6 6-phospho-D-gluco… NA NA "" NA NA NA #> 7 7 acetyl-CoA NA NA "" NA NA NA #> 8 8 aconitate NA NA "" NA NA NA #> 9 9 adenosine NA NA "" NA NA NA #> 10 10 ADP NA NA "" NA NA NA #> # … with 96 more rows, and 4 more variables: searchTableName <chr>, #> # label <chr>, peak_label <chr>, method_tag <chr> #> #> $samples #> # A tibble: 136 × 13 #> sampleId name filename samples_tbl_row sample_name month replicate DR #> <fct> <chr> <chr> <int> <chr> <chr> <chr> <dbl> #> 1 1 NH4_0.0… NA 1 NH4_0.055_f… Jun B 0.055 #> 2 2 NH4_0.0… NA 2 NH4_0.055_f… Jun D 0.055 #> 3 3 NH4_0.0… NA 3 NH4_0.055_p… Jun A 0.055 #> 4 4 NH4_0.0… NA 4 NH4_0.055_p… Jun C 0.055 #> 5 5 NH4_0.1… NA 5 NH4_0.173_f… Jun B 0.173 #> 6 6 NH4_0.1… NA 6 NH4_0.173_f… Jun D 0.173 #> 7 7 NH4_0.1… NA 7 NH4_0.173_p… Jun A 0.173 #> 8 8 NH4_0.1… NA 8 NH4_0.173_p… Jun C 0.173 #> 9 9 NH4_0.2… NA 9 NH4_0.210_f… Jun B 0.21 #> 10 10 NH4_0.2… NA 10 NH4_0.210_f… Jun D 0.21 #> # … with 126 more rows, and 5 more variables: limitation <chr>, exp_ref <chr>, #> # extraction <chr>, condition <int>, reference <int> #> #> $measurements #> # A tibble: 14,416 × 4 #> groupId sampleId log2_abundance centered_log2_abundance #> <fct> <fct> <dbl> <dbl> #> 1 2 1 8.23 -1.27 #> 2 4 1 8.23 -0.816 #> 3 15 1 8.23 -4.60 #> 4 25 1 8.23 -3.23 #> 5 26 1 8.23 -2.21 #> 6 30 1 8.23 -1.18 #> 7 40 1 8.23 -0.318 #> 8 51 1 8.23 -1.10 #> 9 56 1 8.23 -0.448 #> 10 57 1 8.23 -3.80 #> # … with 14,406 more rows #> #> $design #> $design$features #> # A tibble: 12 × 2 #> variable type #> <chr> <chr> #> 1 groupId feature_primary_key #> 2 compoundName character #> 3 smiles character #> 4 adductName character #> 5 tagString character #> 6 mz numeric #> 7 rt numeric #> 8 compoundDB character #> 9 searchTableName character #> 10 label character #> 11 peak_label character #> 12 method_tag character #> #> $design$samples #> # A tibble: 13 × 2 #> variable type #> <chr> <chr> #> 1 sampleId sample_primary_key #> 2 name character #> 3 filename character #> 4 samples_tbl_row integer #> 5 sample_name character #> 6 month character #> 7 replicate character #> 8 DR numeric #> 9 limitation character #> 10 exp_ref character #> 11 extraction character #> 12 condition integer #> 13 reference integer #> #> $design$measurements #> # A tibble: 4 × 2 #> variable type #> <chr> <chr> #> 1 groupId feature_primary_key #> 2 sampleId sample_primary_key #> 3 log2_abundance numeric #> 4 centered_log2_abundance numeric #> #> $design$feature_pk #> [1] "groupId" #> #> $design$sample_pk #> [1] "sampleId" #> #> #> attr(,"class") #> [1] "triple_omic" "tomic" "mzroll"