The files included here allow to replicate the analyses showed in the four boxes of "EggLib 3: a Python package for population genetics and genomics".

Each box is under a separate folder:

-Box 1 is based on a VCF file of chromosome 15 of Melampsora larici-populina from Persoons et al. (2021). 
The script.py file allows to calculate several diversity statistics using a sliding window and stores the results in a file. 
The plot.py file plots the results (one needs to have the package matplotlib installed to run it).

-Box 2 imports genetic data from a genepop file and calculate a number of diversity statistics using alternative structures (script.py ). 
The data used in this example have been simulated with EggLib.

-Box 3 computes diversity statistics in protein-coding regions. The data used in this example have been simulated with EggLib.

-Box 4 is based on 1038 fasta files containing unaligned coding DNA sequences of orthologous genes in 4 species of Verminephrobacter (Kjeldsen et al., 2012). 
The analysis script (script.py) generate the protein-based alignement to guide the nucleotide alignment. 
Then a phylogenetic tree is reconstructed using PhyML, the length of the tree is recorded. 
The tree is then used by the program CodeML to estimate the non-synonymous to synonymous substitution rate.
Note that this script can only work if muscle, PhyML and CodeML are installed on the system and available in the path.



References:
Kjeldsen KU, Bataillon T, Pinel N, et al. (2012). Purifying Selection and Molecular Adaptation in the Genome of Verminephrobacter, the Heritable Symbiotic Bacteria of Earthworms. Genome Biology and Evolution, 4:307-315.
Persoons A, Maupetit A, Louet C, et al. (2022). Genomic Signatures of a Major Adaptive Event in the Pathogenic Fungus Melampsora larici-populina. Genome Biology and Evolution, 14(1).

