This repository provides three ways to create meadow plots and candidate-peak summaries from windowed nucleotide diversity (π) and Fst output generated by pixy:
- Website: paigeduffin.github.io/meadow_plot_tutorial presents the tutorial as a polished, copy-and-run guide.
- Command line:
scripts/meadow_plot_cli.Rruns the complete analysis from a terminal. - R Markdown:
tutorials/meadow_plot_tutorial.Rmdsupports a more interactive, section-by-section workflow.
Clone the repository:
git clone https://github.com/paigeduffin/meadow_plot_tutorial.gitInstall the required R packages:
install.packages(c(
"dplyr", "tidyr", "readr", "ggplot2", "tibble",
"gridExtra", "ggtext", "scales", "gtable"
))Place the four required input files in input/, then run the command-line version with the absolute path to the cloned project:
Rscript scripts/meadow_plot_cli.R /absolute/path/to/meadow_plot_tutorialThe command-line script does not change the working directory. Paths supplied after the project directory may be absolute or relative to the project directory.
| File | Required columns |
|---|---|
| Fst output | pop1, pop2, chromosome, window_pos_1, window_pos_2, avg_wc_fst |
| π output | pop, chromosome, window_pos_1, window_pos_2, avg_pi |
| Comparison map | comp, population_1, population_2, plot_order |
| Chromosome map | chromosome, chromo.num |
The default filenames and full command-line syntax are documented in input/README.md and are displayed with:
Rscript scripts/meadow_plot_cli.R --helpProcessed tables are written to wrangled_data/. Meadow plots and the candidate-peak size plot are written to plots/. These output directories are created automatically and are ignored by Git.
meadow_plot_tutorial/
├── docs/ # Published website
├── input/ # Example or user-supplied input files
├── scripts/
│ ├── meadow_plot_cli.R # Command-line workflow
│ └── build_website.sh # Rebuilds the website with Pandoc
├── tutorials/
│ └── meadow_plot_tutorial.Rmd # Interactive R Markdown workflow
└── website/ # Website template
This workflow accompanies the meadow-plot analysis described in Duffin et al. (2026). Citation details will be added when available.