Data from: Sex-biased cooperation among immature peers: It matters who helps whom
Data files
Oct 01, 2025 version files 34.39 MB
-
Closed_model.m
6.23 KB
-
Data_analysis.ipynb
31.79 MB
-
DataFigS1_D.pini_sex_ratio_natural_populations.xlsx
11.64 KB
-
Model_1_datagen.ipynb
947.65 KB
-
Model_2_datagen.ipynb
1.63 MB
-
README.md
3.48 KB
Abstract
Our understanding of sex-biased helping has progressed from a historical emphasis on relatedness differences caused by haplodiploidy to an understanding of the role played by the rarer-sex effect. Theory to date typically assumes that offspring help their mother. We show that an alternative, peer-to-peer cooperation, can shed light on the interaction of helpers and the recipients of help. In pine sawfly (Diprion pini) larvae, larval peer-to-peer cooperation takes the form of collective, and individually costly, antipredator behaviour. Larvae typically occur in mixed-sex groups, but females can lay unfertilized eggs that develop into haploid males, which produce male-only broods. Female-biased sex ratios typically select for female-biased helping, and our model here matches empirical findings. Alternative scenarios provide insight too: (1) if genetic constraints permit no sex-specificity in behaviour beyond haploid males expressing all alleles while helping in females can be recessive or dominant, then the sex difference in helping simply reflects the effects of dominance. (2) Female-biased helping can also emerge under male-biased sex ratios, if males are mostly produced in single-sex broods by unmated mothers. While this last example remains hypothetical for D. pini, it highlights an underappreciated point: the rarer-sex effect impacts solutions not only by modifying fitness prospects of the helper, but also of the recipient of help.
Dataset DOI: 10.5061/dryad.3xsj3txvb
Description of the data and file structure
This dataset contains simulation and analysis code used to study an alternative, peer-to-peer cooperation, which can shed light on the interaction of helpers and the recipients of help. The models track the proportion of defenders among males, females, and the total population under different genetic assumptions. Code used to generate the .csv data files and analysis notebooks is included, along with supplementary data from pine sawfly populations. Detailed information about all the parameters of the model are present in the supplementary.
Files and variables
File: Closed_model.m
Description: MATLAB script for a closed model for the coevolution of sex ratio and sex-specific defence. This model is included in the supplementary analyses.
File: Model_1_datagen.ipynb
Description: Jupyter notebook for the constrained model, where males and females share the defense locus.
- Produces 6
.csvfiles of defender proportions:BM_f_dom_u<value>_r<value>– female defender proportion (dominant allele case).BM_m_dom_u<value>_r<value>– male defender proportion (dominant).BM_t_dom_u<value>_r<value>– total defender proportion (dominant).BM_f_rec_u<value>_r<value>– female defender proportion (recessive).BM_m_rec_u<value>_r<value>– male defender proportion (recessive).BM_t_rec_u<value>_r<value>– total defender proportion (recessive).
File: Model_2_datagen.ipynb
Description: Jupyter notebook for the unconstrained model, where males and females have separate defense loci.
- Produces 6
.csvfiles of defender proportions:ML_f_dom_u<value>_r<value>– female defender proportion (dominant allele case).ML_m_dom_u<value>_r<value>– male defender proportion (dominant).ML_t_dom_u<value>_r<value>– total defender proportion (dominant).ML_f_rec_u<value>_r<value>– female defender proportion (recessive).ML_m_rec_u<value>_r<value>– male defender proportion (recessive).ML_t_rec_u<value>_r<value>– total defender proportion (recessive).
File: Data_analysis.ipynb
Description: Jupyter notebook to analyze the .csv outputs from Model1 and Model2. Generates the main figures used in the manuscript.
File: DataFigS1_D.pini_sex_ratio_natural_populations.xlsx
Description: Spreadsheet of sex ratio data from pine sawfly populations. Used in Figure S1.
- Columns:
population,group ID,number of females,number of males,sex ratio.
Code/software
- MATLAB is needed to run the
Closed_model.m - Julia is required for
Model_1_datagen.ipynb, andModel_2_datagen.ipynb - Python is required to run
Data_analysis.ipynb
All the required dependencies are mentioned in the code files.
Usage
- Open
Model_1_datagen.ipynborModel_2_datagen.ipynbin Jupyter and run all cells to generate.csvoutput files. - Open
Data_analysis.ipynbto process the.csvfiles and recreate the manuscript figures. - The
.xlsxfile can be opened in Excel or any spreadsheet program for reference.
Access information
Other publicly accessible locations of the data:
