Neutrality test (dN/dS and H statistic)

To identify the loci under positive selection, we performed dN/dS analysis. For each cluster obtained from ClusterPicker, we used the most similar homolog in snapdragon (Antirrhimum majus L.; Li, Zhang, et al. (2019)) as ancestral NLR ortholog sequence for the sequences in the cluster and conducted multiple sequence alignment using MAFFT, estimated phylogenetic tree with FastTree and reverse-transcribed the alignment of the sequences. We calculated the dN/dS ratios (ratio between non-synonymous mutations and synonymous mutations) using PAML software (Yang, 2007) within each of the clusters and used ratio >1 as an indicator of putative positive selection. We also calculated per base dN/dS ratios since, due to functional constraints on conserved protein domains, it is much more likely that certain regions in a gene are under selective pressure rather than the whole gene.
We carried out the Fay & Wu H statistic analysis (Fay & Wu, 2000) on NLR transcripts by mapping the Plantago reads to the reference transcriptome assembly using ANGSD software (Korneliussen, Albrechtsen, & Nielsen, 2014). To identify loci under selective pressure, we calculated the Fay & Wu H (H) values within a sliding window of nine nucleotides. We chose H values less than -3.5 to signify selection. Functional domains within the transcripts were identified with InterProScan (Jones et al., 2014) search with the online InterPro service of the EMBL-EBI website (Mitchell et al., 2019). The significant H value loci were plotted against the transcript domain structure in R.