Allele & SNP Scans Module
scan.RmdDeveloper’s Guide to the
qtl2shiny Package
Overview
The Allele & SNP Scans panel helps researchers run genome scans to identify QTL signals and overlay high-density variant mappings to narrow down candidate genes. It integrates:
-
scanDataApp: Generates founder-allele-based genome scans (LOD and BLUP curves). -
snpGeneApp: Performs high-density SNP association scans, annotations, and gene/exon coordinate views.
Module Hierarchy & Entrypoints
-
Top-Level Container:
- Standalone Application:
scanApp() - Server Module:
scanServer(id, hotspot_list, snp_list, probs_obj, project_df) - UI Input:
scanInput(id) - UI Output:
scanOutput(id)
- Standalone Application:
-
Allele Scan Sub-Modules:
-
Allele Scan Data (
scanDataApp): Computes and plots allele LOD/BLUP scans. Server:scanDataServer.
-
Allele Scan Data (
-
SNP & Gene Sub-Modules:
-
SNP/Gene Subpanel (
snpGeneApp): Server:snpGeneServer. -
SNP Plot (
snpPlotApp): Renders Manhattan SNP plots. Server:snpPlotServer. -
SNP Table (
snpTableApp): Searchable variants datatable. Server:snpTableServer. -
Gene region (
geneRegionApp): Displays gene tracks. Server:geneRegionServer. -
Exon detail (
geneExonApp): Exon structure database lookup. Server:geneExonServer.
-
SNP/Gene Subpanel (
1. Top-Level Container (scanApp)
Server Logic & Reactive Flow (scanServer)
The panel coordinates coordinates from the
hotspot_list$win_par global sidebar, queries allele
coefficients, and handles download outputs:
-
Instantiation:
- Calls
scanDataServerto handle founder allele calculations. - Calls
snpGeneServerto coordinate high-density associations and gene annotation overlays.
- Calls
-
Download Handling:
- Routes plot/table downloads by checking
input$hap_tab:-
scan: Downloads plots/tables of allele-based genome scans. -
snp: Downloads SNP plots, tables, gene maps, or exon charts.
-
- Routes plot/table downloads by checking
graph TD
HotspotList[hotspot_list] --> scanServer
SnpList[snp_list] --> scanServer
Probs[probs_obj] --> scanServer
scanServer --> scanData[scanDataServer]
scanServer --> snpGene[snpGeneServer]
snpGene --> snpPlot[snpPlotServer]
snpGene --> snpTable[snpTableServer]
snpGene --> geneRegion[geneRegionServer]
snpGene --> geneExon[geneExonServer]
2. Allele Genome Scans (scanDataApp)
Data Used
-
Genotype Probabilities (
probs_obj): disk-backed multi-point probabilities loaded viaprobsServer. -
LOCO Kinship Matrices: kinship objects
corresponding to the active chromosome
(
hotspot_list$kinship_list). -
Phenotypes & Covariates:
hotspot_list$pheno_mxandhotspot_list$covar_df.
Logic and Code Workflow
-
QTL Scanning:
- Computes QTL genome scans using
qtl2::scan1()for the selected phenotype, accounting for covariates and kinship models.
- Computes QTL genome scans using
-
Founder BLUPs/Coefficients:
- Runs linear regression mapping founder coefficients along chromosomes to show direction and magnitude of effects.
-
Plotting:
- Renders LOD or BLUP curves.
3. SNP Association & Gene Mapping (snpGeneApp &
Sub-modules)
Data Used
-
SNP Probabilities SQLite DB
(
cc-variants.sqlite): High-density variants query function (query_variants). -
Gene Annotation SQLite DB
(
mouse_genes_mgi.sqlite): Database listing gene boundaries (query_genes).
Logic and Code Workflow
-
SNP Scan & Association:
- Collaborates with
snpListServerwhich collapses founder probabilities into SNP patterns (snpprob_collapse). - Runs fast association mappings (
scan1covar) to calculate SNP LOD scores.
- Collaborates with
-
Manhattan Plots (
snpPlotServer):- Plots SNP LOD scores vs. coordinates in Mbp.
-
Gene Overlay (
geneRegionServer):- Queries
query_genesand maps structural genes inside the chromosomal window.
- Queries
-
Exon Structure (
geneExonApp):- Evaluates user clicks on candidate genes to pull transcript profiles, mapping coding/non-coding exons.