Data and code to reproduce each figure in the xQTL manuscript
Install Jupyter Book and related tools
pip install jupyter-book ghp-importCreate a new Jupyter Book in the root directory of this project:
jupyter-book create websiteThe created template will have:
_config.yml: Configuration for the book_toc.yml: Table of contents structure- Sample content files
Let's customize these for this project:
Create or modify the _config.yml file:
# Book settings
title: FunGen-xQTL Manuscript Repository
author: FunGen-AD Consortium
copyright: "2025" # Current year
# Force re-execution of notebooks on each build
execute:
execute_notebooks: force
# Define the name of the latex output file for PDF builds
latex:
latex_documents:
targetname: book.tex
# Add a bibtex file for citations
bibtex_bibfiles:
- references.bib
# Information about where the book exists on the web
repository:
url: https://github.com/StatFunGen/xqtl-paper
branch: main
# Add GitHub buttons to your book
html:
use_issues_button: true
use_repository_button: trueCreate or modify _toc.yml file to include all figure notebooks and analysis sections:
# Table of contents
# Learn more at https://jupyterbook.org/customize/toc.html
format: jb-book
root: README
chapters:
- file: main_text/1_project_overview/index
- file: main_text/2_single_context_cis/index
- file: main_text/3_single_context_multigene_trans/index
- file: main_text/4_multi_context/index
- file: main_text/5_AD_xQTL_integration/index
- file: main_text/6_AD_xQTL_genes/indexThe repository is now structured with the following organization:
main_text/
├── 1_project_overview/
│ ├── index.md (FunGen-xQTL atlas and companion projects)
│ └── figure_data/README.md
├── 2_single_context_cis/
│ ├── index.md (Single context cis-xQTL fine-mapping)
│ └── figure_data/README.md
├── 3_single_context_multigene_trans/
│ ├── index.md (Multi-gene and trans-xQTL fine-mapping)
│ └── figure_data/README.md
├── 4_multi_context/
│ ├── index.md (Propagation of multi-context xQTL effects)
│ └── figure_data/README.md
├── 5_AD_xQTL_integration/
│ ├── index.md (Alzheimer's disease (AD) loci integration)
│ └── figure_data/README.md
└── 6_AD_xQTL_genes/
├── index.md (Insights into AD risk genes)
└── figure_data/README.md
supplementary_tables/
└── README.md (Placeholder linking to Google Drive document)
README.md: Landing page for the Jupyter Bookreferences.bib: Bibliography file for citations
Each figure_data folder contains RDS format data files with the minimum information necessary to reproduce plot figures, allowing users to check numerical values.
jupyter-book build . --config website/_config.yml --toc website/_toc.ymlThis will generate the HTML files in the _build/html directory.
Use ghp-import to publish your book:
ghp-import -n -p -f _build/htmlThis will:
- Copy the contents of
_build/htmlto a branch calledgh-pages - Push this branch to GitHub
- Configure it as a GitHub Pages source
- Go to your repository on GitHub
- Navigate to Settings > Pages
- Ensure the source is set to the
gh-pagesbranch and the folder is/ (root) - Save the settings
The site should be live at: https://statfungen.github.io/xqtl-paper/
The repository includes a GitHub Actions workflow (.github/workflows/deploy-book.yml) that automatically rebuilds and publishes your book whenever you push changes to the main branch.
The workflow:
- Sets up Python 3.9
- Installs jupyter-book and ghp-import
- Builds the book using your custom configuration
- Deploys to GitHub Pages
This ensures your website is always up-to-date with the latest changes in your repository.
To add new analyses or figures:
- Create notebook files (.ipynb) or markdown files (.md)
- Add them to the
_toc.ymlfile in the appropriate section - Push to the main branch - the site will automatically rebuild
- Ensure all files referenced in
_toc.ymlexist - Check that notebook dependencies are properly specified
- Verify GitHub Pages is enabled in repository settings
- Check GitHub Actions logs for build errors