We aimed to explore the potential role of epigenetic modifications in the immune response to a group-living species with low genetic diversity. To do this, we compared the genome-wide DNA methylation profiles of five colonies of social spiders (Stegodyphus dumicola) in their natural habitat in Namibia at the point just before they succumbed to infection to a point at least six months previously where they were presumably healthier.
We used whole genome bisulfite sequencing to generate the sequences, and extracted the information on methylation using bismark. We then analysed the sequences for whole genome, chromosome, gene-level, and base-level changes in methylation between the healthy/alive and infected/dying timepoints.
The code provided gives:
For all but the first file, the scripts need to be modified and repeated in order to conduct the same analysis on the CHG and CHH contexts (although note that the gene-level CHH context analysis is not possible).
For some analyses you will need the .gff3 annotation file, available from NCBI GenBank Bioproject PRJNA510316. The analysis of differentially methylated bases uses a FASTA file, available on reasonable request.
Some R packages need to be installed and loaded, the "library" function for each is given at the start of the scripts, but you will need to install them yourself first if they are not already installed in your R.