Skip to content

Latest commit

 

History

77 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Meadow plot tutorial

This repository provides three ways to create meadow plots and candidate-peak summaries from windowed nucleotide diversity (π) and Fst output generated by pixy:

  1. Website: paigeduffin.github.io/meadow_plot_tutorial presents the tutorial as a polished, copy-and-run guide.
  2. Command line: scripts/meadow_plot_cli.R runs the complete analysis from a terminal.
  3. R Markdown: tutorials/meadow_plot_tutorial.Rmd supports a more interactive, section-by-section workflow.

Quick start

Clone the repository:

git clone https://github.com/paigeduffin/meadow_plot_tutorial.git

Install 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_tutorial

The command-line script does not change the working directory. Paths supplied after the project directory may be absolute or relative to the project directory.

Required input files

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 --help

Outputs

Processed 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.

Repository structure

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

Citation

This workflow accompanies the meadow-plot analysis described in Duffin et al. (2026). Citation details will be added when available.

About

An R tutorial for creating meadow plots from windowed pixy Fst and nucleotide diversity output as in Duffin et al. (2026).

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages