https://github.com/atgenomix/atgwas
gwasViewer: R Shiny app for interactive GWAS result exploration powered by Spark
https://github.com/atgenomix/atgwas
gwas manhattan-plot r shiny spark
Last synced: 3 months ago
JSON representation
gwasViewer: R Shiny app for interactive GWAS result exploration powered by Spark
- Host: GitHub
- URL: https://github.com/atgenomix/atgwas
- Owner: atgenomix
- License: other
- Created: 2025-04-18T15:10:21.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-05-14T08:06:39.000Z (5 months ago)
- Last Synced: 2025-06-07T18:01:47.556Z (4 months ago)
- Topics: gwas, manhattan-plot, r, shiny, spark
- Language: R
- Homepage: https://atgenomix.github.io/atgwas
- Size: 56.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gwasViewer: Spark-Powered Shiny App for GWAS Visualization
gwasViewer is an interactive R Shiny application designed for **Genome-Wide Association Study (GWAS)** result exploration. It connects directly to a **Spark-based catalog**, enabling scalable analysis of large GWAS summary statistics.
## ๐ Features
- ๐ **Interactive Manhattan Plot** using Plotly
- ๐ **QQ Plot** for visualizing p-value distributions
- ๐งฌ **GWAS Table Viewer** with download support
- ๐ **Dynamic database selector** based on Spark catalog
- โก **High-performance Spark backend** with `sparklyr`
- ๐จ Customizable genome-wide significance threshold## ๐ฆ Required R Packages
The app imports the following packages:
```r
shiny, qqman, DT, sparklyr, DBI, shinycssloaders, plotly, scales, dplyr
````Install them via:
```r
install.packages(c("shiny", "qqman", "DT", "DBI", "shinycssloaders", "plotly", "scales", "dplyr"))
# For sparklyr
install.packages("sparklyr")
```## ๐ง Usage
```r
# Install from GitHub
remotes::install_github("atgenomix/atgwas")
# Launch the viewer
atgwas::gwasViewer()
```### ๐ฅ๏ธ UI Overview
* **Sidebar**
* `Genome-wide threshold`: Customize p-value significance cutoff
* `Database Selector`: Choose Spark SQL database to analyze* **Tabs**
* `Table`: Displays the GWAS result table with CSV export
* `QQ Plot`: Observed vs expected p-values (supports PNG export)
* `Manhattan`: Interactive Manhattan plot with zoom, tooltips## ๐ Data Requirements
The selected Spark database table must contain at least:
* `CHR`: Chromosome identifier
* `BP`: Base-pair position
* `P`: p-value
* (Optional) `SNP`: Variant ID## ๐ Visualization Details
### Manhattan Plot
Significant variants (e.g., `P < 5e-8`) are highlighted interactively. The app preprocesses and subsets data to optimize rendering for large datasets.
### QQ Plot
Displays p-value inflation/deflation to detect population stratification or biases.
## ๐งช Developer Modules
* `dbBrowserUI()` / `dbBrowserServer()` โ Spark database selection
* `sparkConnectionUI()` / `sparkConnectionServer()` โ Custom Spark connection
* `plot_manhattan()` โ Static ggplot2-based Manhattan plot
* `prep_manhattan()` โ Data preprocessing for Manhattan plot## ๐ค Export Options
* **CSV Download** โ Filtered GWAS result table
* **PNG Download** โ QQ Plot## ๐จโ๐ฌ Example Workflow
1. Start the app and connect to your Spark master
2. Select a database from the sidebar
3. View and download the GWAS summary table
4. Switch to the QQ plot tab and export as PNG
5. Explore the Manhattan plot interactively---
## ๐ License
This project is licensed under the **Apache License 2.0**.
See the [LICENSE](./LICENSE) file for details.
## ๐ค Acknowledgements* [`sparklyr`](https://spark.rstudio.com/)
* [`plotly`](https://plotly.com/r/)
* [`DT`](https://rstudio.github.io/DT/)
* [`shiny`](https://shiny.rstudio.com/)