How m3metabolomics/metabolink works
Project type and purpose
• MetaboLink is a full-stack R/Shiny web application for processing and analyzing large-scale untargeted metabolomics data.
• It provides a GUI (ui.R + www folder) backed by server logic (server.R + global.R + modular scripts in R/) and is packaged in a Docker container.
File structure
Top-level:
• Dockerfile → environment and deployment
• README.md, LICENSE.md → docs
• csvfiles/ → lookup tables (adducts.csv)
• example_files/ → sample input data
• server.R, ui.R, global.R, functions.R, test.R → Shiny app entry points and common functions
• R/ → discrete processing modules (blank_filtration.R, normalization.R, pca.R, statistical_analysis.R, export.R, etc.)
• www/ → frontend assets (CallShiny.js)
README
• Describes deployment via Docker (port 3838), external Bioconductor and CRAN dependencies.
• Points to a Wiki for user documentation.
• Emphasizes that users upload CSVs and obtain processed results & visualizations.
Main components & their interactions
a. Presentation Layer
– User’s browser ←→ Shiny UI (ui.R + www/CallShiny.js + intro_text.html)
b. Application/Control Layer
– server.R & global.R receive inputs from UI, orchestrate workflows
– functions.R holds helper functions
c. Processing Modules (Model Layer)
– R/*.R each implement a step in the pipeline:
• blank_filtration.R
• missing_value_filtration.R
• imputation.R
• drift_correction.R
• normalization.R
• pca.R
• statistical_analysis.R
• export.R
• merge.R, data_utils.R, upload_utils.R, internal_standards.R
d. Data Sources
– csvfiles/adducts.csv (reference)
– User-provided CSVs (example_files/)
e. External Dependencies & Deployment
– R packages installed via BiocManager/CRAN
– Docker container wrapping Shiny Server (exposes 3838)
Relationships & data flow
1. User uploads CSV → upload_utils.R
2. Data merges and reference lookup via merge.R + data_utils.R
3. Filtration steps (blank, missing-value)
4. Imputation → drift correction → normalization
5. Dimensionality reduction (PCA) → statistical analysis
6. Results formatted & exported via export.R
7. UI renders plots (plotly/ggplot2) and tables
Architectural patterns & design principles
• MVC‐esque separation: ui.R (View), server.R (Controller), R modules (Model)
• Functional decomposition: each step in distinct R scripts
• Containerization: reproducible environment with Docker
• Reactive programming: Shiny’s reactive graph connects UI inputs to module outputs