Skip to content

feat: Build Interactive GWAS Explorer with Mock Data - #12

Open
mohamed-laarej wants to merge 5 commits into
masterfrom
feature/interactive-visualization
Open

feat: Build Interactive GWAS Explorer with Mock Data#12
mohamed-laarej wants to merge 5 commits into
masterfrom
feature/interactive-visualization

Conversation

@mohamed-laarej

Copy link
Copy Markdown
Collaborator

Hi @jonbrenas ,

This PR introduces the first version of the interactive GWAS Explorer, a standalone HTML dashboard built with Bokeh.
It's designed to visualize our GWAS results in an elegant, tabbed interface that follows a logical "discovery → zoom → detail" workflow.

This initial version uses a mock dataset where I tried to simulate a full genome-wide scan.
It’s not necessarily very realistic, but it provides a working foundation for building and testing the interactive pipeline.
Once we have the real outputs from the GWAS scanner tool, we can simply replace the mock files with the actual data.

What's Included in this PR

1. Mock Data Generation & Verification (src/data/ and notebooks/)

  • generate_mock_data.py: Creates a two-part mock dataset:
    • A simulated full genome-wide scan with a textured background and significant peaks.
    • A corresponding file with detailed verification results (log-odds, CIs) for the top hits (Mixed-Effects model).
  • Notebook 08_mock_data_workflow.ipynb: Runs the generator, verifies file creation, and provides a quick visualization to confirm the dataset looks realistic.

2. Interactive Visualization Builder (src/viz/)

  • build_explorer.py: Reads the mock data and generates a single, self-contained gwas_explorer.html file in /output.
  • The dashboard provides a three-tab layout:
    1. Genome-Wide Scan: Full Manhattan plot with BoxSelect tool.
    2. Regional Detail: Zoom-in view of selected regions, showing all SNPs from the fast scan + overlaid verified hits.
    3. SNP Detail: Displays effect size and confidence interval for a selected verified hit (Mixed-Effects model).

I’m really excited about how this is shaping up and would greatly appreciate your feedback - on the code, visualization structure, or any ideas for improvements.

Thank you!

Adds a script to generate realistic GWAS mock data, including a full scan, verified hits, and gene annotations.

Includes a new notebook to run the generator and verify the output dataframes, ensuring a solid foundation for the visualization.
Creates the main visualization script .

This script loads the mock data and generates a standalone HTML file featuring a three-panel tabbed layout (Manhattan, Regional, SNP Detail) with full interactivity linking the plots.
@jonbrenas

Copy link
Copy Markdown
Collaborator

Thanks @mohamed-laarej. This sounds like a great piece of work. Could you push the html file? Or is it too big to be added to GitHub?

@mohamed-laarej

Copy link
Copy Markdown
Collaborator Author

Thanks for the feedback, @jonbrenas !
My initial thinking was to follow the standard practice of using .gitignore to keep generated files out of the repository.
But you're right that having the HTML file here makes the visualization much easier to review. The file isn't too big, so I will update the .gitignore now and push the output file for you to see directly.

@mohamed-laarej

Copy link
Copy Markdown
Collaborator Author

Quick follow-up: The HTML file has been pushed. It ended up being a bit large (~43 MB) – I need to redefine the meaning of "large" that I have! 😅
This is fine for the review, but for the long-term health of the repository, I'll plan to remove it from the Git history after this PR is merged. For any future updates, I'll use a temporary link to avoid bloating the repo.
Looking forward to your feedback!

@jonbrenas

Copy link
Copy Markdown
Collaborator

I looked at the HTML and it looks really nice!
I think adding a few lines at the top explaining how to use it would help (I was a little confused when I got to the second tab and it was empty). Also the labels on the X-axis look a little strange (3L 3R and big numbers). In the second tab, all the dots (including the genes) that are not verified hits still have some hover text that is empty which makes it look a little odd. It would also be great to have all genes represented (and some metadata in the hover text) instead of just the two. None of that is too important, though.

…bug fixes

Updates the GWAS Explorer dashboard and data generator to address mentor feedback. Changes include more realistic mock data, clearer UI instructions, improved hover tools, better gene label handling, and fixes to tab switching and region re-selection.
@jonbrenas

Copy link
Copy Markdown
Collaborator

Great work @mohamed-laarej ! I think the Dashboard is much easier to understand now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants