Design, Development, Reactivity, and Scale
2026-06-18
Core References
Several packages and applications illustrate an evolving design pattern aimed at improving usability, performance, and debuggability:
Designed for QTL analysis at scale, organized as an R package with separate shiny modules.
qtlServer.R: Top-level server logic.
mainParServer.R: Shared parameters.
traitServer.R: Dataset display and returns trait_list.scanServer.R: Reads scans from files.peakServer.R: Reads peaks from files.qtlSetup.R: Standard initialization script to locate and load files into the environment.app.R: Deployable entry-point script calling the modules.QTL_plot_visualizer.R) and analysis (trait_scan.R, peak_finder.R).Uses the standard Old Faithful geyser app to illustrate module composition and connection logic:
hist.R / gghist.R: Base & ggplot histogram.ggpoint.R: Scatterplot modules.data.R / datasets.R: Data loader modules.rows.R / wrapper.R / switch.R: Connect controllers.appPages.R.appRows.R / appRowsModule.R.appTwin.R / appDupe.R / appFlip.R.app.R (see deployed Geyser Demo).Tip
See the Geyser Shiny Modules Slides and 11 Dec 2024 Presentation for walk-throughs.
Powers three active research portals for the Attie Lab:
download.R for exports, volcano.R for plots).To prevent code duplication, inputs are scoped at three distinct levels: 1. mainPar: Shared parameters (e.g. dataset choice, height) globally available. 2. panelPar: Localized settings for a specific dashboard panel (e.g. strains, sex, facet overlays). 3. plotPar: Specific options limited to visualization plots.
Reactive Data Flow
Inputs are passed directly into the foundr module. The application avoids global variables; instead, static inputs are filtered into small reactive subsets based on user panels.
A key architectural shift was completely separating data analysis from the reactive Shiny interface.
Designed for local QTL investigations within a 1-4Mb peak region, including LOD scans, SNP association, and mediation:
The modernization branch (byandell-refactor) reorganizes server calls: - mainServer.R - dashServer.R - setupServer.R: project, pheno, peaks. - haploServer.R: probs, snpSetup, scanCoef, mediate. - diploServer.R: pairProbs, snpSetup, pattern.
shinydashboard layouts to modern, responsive bslib dashboards.download.R module.shiny_modulepackage:
Version Notes
The original qtl2shiny repository contains legacy module syntax. Active retooling is recommended to migrate functions into compliant server/UI wrappers for easier testing.
Modular Shiny Applications