Differential Expression Analysis on Mzroll List

diffex_mzroll(
  mzroll_list,
  value_var,
  test_model,
  null_model = NULL,
  additional_grouping_vars = NULL,
  fdr_by_groupings = FALSE
)

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)

value_var

measurement variable

test_model

a RHS formula for regression

null_model

if provided a null RHS formula to compare to test_model using the likelihood-ratio test.

additional_grouping_vars

sample-, or measurement-level variables to groupby when performing regression in addition to groupId.

fdr_by_groupings

if TRUE then calculate FDR separately across additional_grouping_vars (if they exist).

Value

a tibble of significance tests for each feature

Examples

# standard feature-wise regression diffex_mzroll( nplug_mzroll_normalized, "normalized_log2_abundance", "limitation + limitation:DR + 0" )
#> Warning: q-value calculation initially failed due to too many small p-values #> but claman was able to recover results
#> # A tibble: 1,060 × 8 #> term groupId estimate std.error statistic p.value qvalue diffex_label #> <chr> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <glue> #> 1 limitat… 1 0.423 0.303 1.40 1.82e-1 1.23e-1 1.396 #> 2 limitat… 2 -1.44 0.115 -12.5 1.18e-9 6.07e-8 -12.467 *** #> 3 limitat… 3 -0.00625 0.397 -0.0158 9.88e-1 4.78e-1 -0.016 #> 4 limitat… 4 0.744 0.622 1.20 2.49e-1 1.58e-1 1.196 #> 5 limitat… 5 3.65 0.431 8.48 2.56e-7 1.73e-6 8.485 *** #> 6 limitat… 6 2.43 0.752 3.23 5.26e-3 6.13e-3 3.228 ** #> 7 limitat… 7 -0.817 0.428 -1.91 7.40e-2 6.12e-2 -1.912 * #> 8 limitat… 8 -0.626 0.371 -1.69 1.11e-1 8.64e-2 -1.687 * #> 9 limitat… 9 -3.71 0.457 -8.11 4.64e-7 2.65e-6 -8.111 *** #> 10 limitat… 10 -0.655 0.300 -2.18 4.41e-2 4.05e-2 -2.185 * #> # … with 1,050 more rows
# separate regression for each feature and limitatioon diffex_mzroll( nplug_mzroll_normalized, "normalized_log2_abundance", "DR + 0", additional_grouping_vars = "limitation" )
#> # A tibble: 530 × 9 #> term groupId limitation estimate std.error statistic p.value qvalue #> <chr> <fct> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 DR 1 NH4 6.80 0.580 11.7 0.000303 0.00643 #> 2 DR 1 URA 5.18 1.10 4.70 0.00929 0.0307 #> 3 DR 1 PO4 2.32 5.29 0.438 0.679 0.346 #> 4 DR 1 GLU 7.65 0.573 13.4 0.000182 0.00606 #> 5 DR 1 LEU 7.31 0.585 12.5 0.000236 0.00612 #> 6 DR 2 NH4 -6.95 1.71 -4.08 0.0151 0.0327 #> 7 DR 2 URA 35.5 8.32 4.27 0.0129 0.0321 #> 8 DR 2 PO4 -7.10 1.83 -3.88 0.0116 0.0311 #> 9 DR 2 GLU -6.48 1.67 -3.88 0.0179 0.0345 #> 10 DR 2 LEU -7.00 1.68 -4.16 0.0141 0.0327 #> # … with 520 more rows, and 1 more variable: diffex_label <glue>
# feature-wise ANOVA diffex_mzroll( nplug_mzroll_normalized, "normalized_log2_abundance", "limitation + 0", "0" )
#> Warning: q-value calculation initially failed due to too many small p-values #> but claman was able to recover results
#> # A tibble: 106 × 10 #> term groupId res.df rss df sumsq statistic p.value qvalue #> <chr> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 LRT 1 21 31.1 5 30.8 4.16 8.75e- 3 1.31e- 3 #> 2 LRT 2 21 0.779 5 323. 1743. 9.56e-27 1.16e-25 #> 3 LRT 3 21 12.1 5 3.66 1.27 3.13e- 1 3.66e- 2 #> 4 LRT 4 21 11.0 5 27.3 10.4 3.99e- 5 1.31e- 5 #> 5 LRT 5 21 11.3 5 112. 41.5 3.48e-10 7.05e-10 #> 6 LRT 6 21 42.3 5 53.0 5.25 2.77e- 3 4.68e- 4 #> 7 LRT 7 21 5.23 5 14.5 11.6 1.77e- 5 6.14e- 6 #> 8 LRT 8 21 6.65 5 27.6 17.4 7.53e- 7 4.58e- 7 #> 9 LRT 9 21 21.5 5 148. 28.8 1.01e- 8 1.37e- 8 #> 10 LRT 10 21 2.35 5 1.53 2.72 4.77e- 2 6.30e- 3 #> # … with 96 more rows, and 1 more variable: diffex_label <glue>