scripts for detecting polygenic adaptation in maize using Qpc.
all processed data is in the data folder, generally in .rda files
qpctools contains what's needed for an R package with functions needed to do the analysis.
This package is installed by running the following command:
Rscript install_qpctools.R
You must have the R packages devtools installed already
Other required packages are mass, dplyr, qvalue, LaCroixColoR and viridis
Qpc-gwaspanel.md has scripts for running Qpc in a panel of 240 maize lines with associated phenotypes.
Qpc-ames.md has scripts for running Qpc on polygenic scores to test for polygenic adaptation in the Ames panel.
Qpc-euro.md has scripts for running Qpc on polygenic scores to test for polygenic adaptation in European landraces.
Simulations-traitqpc.md has code for running simulations on trait Qpc in the GWAS panel.
Simulations-polygenicqpc.md has code for running simulations on polygenic Qpc in the ames panel and European landraces.
power_simulations.md has code for running power simulations in the European landraces.
I have not included the files needed to run the simulations because they are quite large, but I can provide them upon request or put them up on figshare if there is demand.
Here is a description of the files in data
263-gwas-results has results from GWAS that correspond to Qpc analysis on polygenic scores in European landraces. These files only have significant hits, the full association mapping results are on figshare
281-gwas-results has results from GWAS that correspond to Qpc analysis on polygenic scores in the Ames panel. The entire output file from GEMMA is available on figshare.
The kinship matrix used in Qpc on traits in the GWAS Panel is in All_240E.nomaf.nomissing.K.
The kinship matrix used in Qpc on polygenic scores in the Ames panel is in ames.281E.K.rda and the matrix for the Ames panel only is in amesOnly.E.K.rda
The kinship matrix used in Qpc on on polygenic scores in the European landraces is in euro.282.E.rda and the landrace-only matrix (after eigendecomposition) is in euro-only-eigen.rda.
240.names, and merged263Landraces.names have the names of individuals in the kinship matrices All_240E.nomaf.nomissing.K and euro.282.E.rda respectively. blup.names ahs the names of the traits in the order they are indexed.
FlintGarciaTableS1.csv has data for the GWAS panel from Flint-Garcia et al. 2005 and eurolandraceinfo.csv has info about the European landraces.
Here are scripts to generate figures used in the preprint
Thanks to Hilary Parker for the guide on making a personal R package: https://hilaryparker.com/2014/04/29/writing-an-r-package-from-scratch/