Code and data for our paper 'Early sexual dimorphism in the developing gut microbiome of northern elephant seals' in Molecular Ecology Stoffel, M.A., Acevedo-Whitehouse, K., Nami Morales-Durán4, Grosser, S., Chakarov. N., Krüger, O., Nichols, H.J. , Elorriaga-Verplancken, F.R. , Hoffman, J.I. See also https://github.com/mastoffel/nes_microbiome The microbiome 16S raw read data are available in the European Nucleotide Archive (ENA) under study accession PRJEB36555. However, all analyses and figures from the main paper and supplementary material can be reproduced with the ASV tables stored in this repository. R-scripts numbered 1_ to 4_ contain the complete data analysis from raw reads to final results/figures. The other R scripts contain some helper functions. The most interesting script is 4_full_analysis.R which contains all the main analyses (whereas 1_ to 3_ contain the bioinformatics and pre-processing). All scripts will run when you arrange them in the following folder structure: Make a data/ folder which contains: health_data.xlsx nes_msats_cleaned.xls ps0.RData ps3.RData sampling_data_processed.xlsx Make an output/ folder which contains one file: mantel_subset_test_final.RData And put another folder in the output folder called: primer_clipped_reads_22_220230_pool/ And this folder should contain: fitGTR.RData seqtab.RData taxa.RData track.RData All R-scripts are stored on the top-level . If you don't use this folder structure, you have to adjust a few paths in the scripts, which shouldn't be a problem either. If you have any problems please contact me | martin.stoffel@ed.ac.uk .