Data from: Different traits dominate evolution at early and late stages of adaptive radiation
Abstract
Adaptive radiation (AR), a process of rapid speciation and ecomorphological diversification, played an important role in generating past and contemporary global biodiversity. An unsolved question is what maintains high rates of speciation during AR, a phenomenon we call “speciation paradox”. One possible explanation for resolving this paradox is a sequential trait evolution, i.e., a series of ecological diversifications, which enables evolving lineages to fully and more effectively exploit the ecological space. We tested this hypothesis using the highly diverse subterranean amphipod genus Niphargus. Niphargus shows distinct signatures of adaptive radiation both at the genus level and at the level of four larger clades. Our analysis revealed decoupled evolution of habitat-related traits and trophic-biology-related traits. Moreover, on a genus level, we found the evidence that AR commences with a tight association between speciation rates and the dynamics of habitat-related traits. At a later stage, speciation dynamics become associated with diversification of trophic-biology-related traits. This suggests that the dependence of macroevolutionary rates in this group switches among niche axes before saturation, resulting in prolonged high speciation rates during AR.
Code.zip contains all R scripts and data needed for analyses in the paper. It is divided in three parts, DECOUPLED DIVERSIFICATION (folder 1), STATES-DEPENDENT SPECIATION AND EXTINCTION (folder 2), AND SPECIATION RATE MODELLING (folder 3).
1) DECOUPLED DIVERSIFICATION
data folder contains phyogeny, morpho and eco data, species by clades, and RDS with imputed values for missing traits. Specifically, it contains the files:
- 20221213_niphargus.tree: phylogeny of Niphargus
- clades.csv: MOTU labels used in phylogeny, with their respective subclade, for four analysed subclades. MOTUs outside of four clades are treated as “backgroud phylogeny” and have no label.
- ecology.xlsx: ecology of each MOTU (categorical variable)
- Groundwater_Amphipoda_functional_trait_database_V1_extended.xlsx: functional trait database, see Premate et al. 2024 for details
- morphology_imputed.rds: R data file with imputed values for missing functional trait data
- speciesA1.txt: MOTUs in subclade A1 (Pannonian)
- speciesA2.txt: MOTUs in subclade A2 (Pontic)
- speciesB.txt: MOTUs in subclade B (South Dinaric)
- speciesC.txt: MOTUs in subclade C (West Balkan)
Niphargus_trait_evolution.rmd file runs neccessary packages and scripts and outputs results. Note that working directory and “result” folder need to be defined before you run the script.
00_data.R: import and data manipulation, including imputation of missing values to morpho ds. All variables needed in later analyses are defined here, including subsets, subclades, etc.
00_functions.R: all custom functions
01_figure1_phylogeny.R: plots half-circle phylogeny
02_regression_PCA.R: runs phylogenetic regression and PCA, and saves results
03_kmeans.R: calculates k-means and saves results
04_modeling.R: runs modeling, ancestral trait reconstruction and morphospace expansion through time, simulations and comparison of morphospace expansion of real and simulated data.
2) STATES-DEPENDENT SPECIATION AND EXTINCTION
This folder includes data and code used for sec_sse analysis. The analysis was run on whole genus and three major clades. Additionally, trophic trait classes were compared with habitat trait class (trophicD and trophicP), so overall, 8 combinations of model comparisons were performed. The folder is thus divided into “clades” and “whole_genus” subfolders. Data and R scripts for model setup (01_model_setup.R), launching the analysis (02_launch_analysis.R) and calculation of AIC values (03_clades_aic_depths.R) are provided.
data folder contains phyogeny (same as above), species by clades (same as above), and transformed continuous morphological traits into categorical (k-means) for each MOTU (k-means are in summary files named kmeans_cladeX.csv, and in files formatted for analysis, named cladeX_traitX.csv). K-means were calculated from Groundwater_Amphipoda_functional_trait_database_V1_extended.xlsx dataset, for four trait classes: habitat PC1, habitatPC2, trophicP and trophicD. See scripts under 1) for details.
3) SPECIATION RATE MODELLING
This folder includes Julia script speciation_rate.jl and data, used for modelling speciation rates through time (birth-death diffusion models), using package Tapestree. Data includes phylogeny in newick format (20221213_niphargus_newick.tre) and sampling completeness file with % of completeness for each species in the tree (niphargus_rho1.csv).
We assembled an extensive dataset on species phylogeny, ecology, and functional morphological traits across the adaptive radiation of Niphargus. We used the molecular taxonomic units (MOTUs) and phylogeny produced in Delić et al. (2025), and morphological and ecological data of analysed species, produced in Premate et al. (2024).
The analyses consist of three parts: decoupled diversification, states-dependent speciation and extinction, and speciation rate modelling. All analyses were first conducted across the entire genus. Next, we looked for independent replicates of diversification within the entire AR. We selected four large monophyletic clades with diversification patterns consistent with AR predictions (Borko et al., 2021).
1) DECOUPLED DIVERSIFICATION
To test whether diversification bursts of the functional trait classes differ in time, we analyzed the dynamics of trait space filling through time for each functional trait class separately (i.e., traits associated with habitat (namely habitatPC1 and habitatPC2) and traits linked to feeding abilities (namely trophicP and trophicD)). For each trait class separately, we first reconstructed ancestral states using the best model of trait evolution, using R packages phytools (Revell, 2024) and mvMORPH (Clavel et al., 2015). Next, we used the best model of trait evolution to reconstruct ancestral states of traits (Clavel et al., 2015). We analysed the course of evolution for each functional trait class by reconstruction of morphospace expansion through time, following the procedure of Ronco et al. (2021).
2) STATES-DEPENDENT SPECIATION AND EXTINCTION
We fitted maximum likelihood SSE models (State-dependent Speciation and Extinction; Maddisson et al., 2007, Herrera-Alsina et al., 2019) where per-lineage speciation rates depended on the particular state of a given trait (i.e., traits associated with habitat (namely habitatPC1 and habitatPC2) and traits linked to feeding abilities (namely trophicP and trophicD)). We modelled trait-class dynamics as the change from one state to another over time.
3) SPECIATION RATE MODELLING
To model speciation rates through time, we used birth-death diffusion (BDD) models, using Julia package Tapestree (Quintero et al., 2024).