How zaoqu-liu/mofs works
Project type and purpose
• This repository is a dual‐module R project composed of:
a) MOFSR: an R package providing functions and data structures for multimodal data fusion, clustering, classification, and enrichment.
b) MOFS‑ShinyApp: a Shiny web application exposing MOFSR functionality through a browser interface.
File structure
• Top‐level directories:
• MOFS‑ShinyApp/ – Shiny front‑end and server code, assets, embedded sample data and documentation.
• MOFSR/ – Standard R package layout (DESCRIPTION, NAMESPACE, R/, data/, man/).
• Figures and global resources (Figure*.R, PyRadiomics parameters.yaml) and overall README.
• MOFS‑ShinyApp substructure follows an MVC-like pattern:
• ui/ – UI modules (home.R, contact.R, help.R, about.R, footer.R).
• server/ – Server logic modules (home.R, help.R, contact.R).
• code/ & db/ – pre‑computed model artifacts and sample inputs.
• lib/ – shared R scripts (package loader).
• www/ – static assets (css, js, images).
• MOFSR package:
• R/ – dozens of R scripts implementing core algorithms (RunMOFS, RunIF, classifiers, feature selection, clustering, evaluation).
• data/ – gene_sets.rda.
• man/ – documentation for every function.
• DESCRIPTION & NAMESPACE define dependencies and exports.
README insights
• Describes multimodal fusion strategies (intermediate + late fusion).
• Highlights key functional areas: feature selection, integration (RunIF, RunMOFS), clustering algorithms, evaluation metrics, classification, enrichment.
• Mentions technologies: Shiny, IntNMF, mogsa, future.apply, tidyverse, Bioconductor packages.
Main components
a. User Interface (Browser)
– Entry point: Shiny UI modules (ui/).
b. Shiny Server
– Orchestrates user requests, loads code from lib/, dispatches to server modules.
– Reads sample data or user‐uploaded data from db/data or external sources.
c. R Package (MOFSR)
– Core engine: functions under R/ for feature selection, fusion, clustering, evaluation, classification, enrichment.
– Data objects: gene_sets.rda, model artifacts (fit.rda).
d. Data Storage
– Static sample data (db/data/InputExample.csv, fit.rda).
– Documentation (doc/help/*.md).
e. External Services & Libraries
– CRAN/Bioconductor dependencies, future parallel backend, JavaScript libraries (jQuery, custom.js) for UI.
Relationships and data flow
• Browser → HTTP/WebSocket → Shiny Server
• Shiny Server calls lib/load_packages.R to load MOFSR and dependencies.
• Server modules invoke MOFSR functions:
• Input ingestion → Preprocessing → FeatureSelection → DataNormalization → Intermediate Fusion (RunIF) → Clustering (IntNMF, CPCA, …) → Late Fusion (RunMOFS) → Evaluation (CalPAC, CalCHI, Silhouette) → Classification (RunEnsemble) → Enrichment (RunGSVA, ssMwwGST).
• Intermediate results and consensus matrices can be cached in code/ or returned live.
• Results are passed back to UI modules for plotting and download.
Architectural patterns and principles
• MVC pattern in Shiny (ui vs server modules).
• Modular R package design: single‐responsibility scripts for each algorithm.
• Layered approach: Data ingestion → Core engine → Visualization.
• Parallelism via future.apply for heavy computations.
• Dependency injection: lib/load_packages.R centralizes library loading.
Relevant technologies and frameworks
• R, Shiny, Bioconductor, CRAN.
• Parallel computing (future.apply, doParallel).
• NMF and PCA (IntNMF, mogsa).
• JavaScript/CSS for UI enhancements.
• Data storage: RDS/RDA, CSV.
Detail
• Every folder’s role in a minimal consolidated form.