Data from: Trapped in the web: network architectures spread coevolution and shape adaptation
Data files
Mar 27, 2026 version files 120.60 MB
-
1_metrics_empirical_networks.Rmd
20.54 KB
-
2_simulation_empirical_networks.Rmd
45.69 KB
-
3_metrics_simulated_networks.Rmd
14.33 KB
-
4_simulation_simulated_networks.Rmd
64.49 KB
-
compute_metrics_networks.R
10.05 KB
-
compute_net_effects.R
2.12 KB
-
demonstration_compute_total_effects.Rmd
8.98 KB
-
df_15replicates_4apr2025dec_simnets.rds
49.67 MB
-
df_20replicates_22june2025_corrected.rds
66.83 MB
-
df_metrics_simulated_nets.rds
509.34 KB
-
df_network_metrics.rds
3.34 MB
-
empirical_networks.zip
34.58 KB
-
Functions.R
23.77 KB
-
generate_network.R
3.77 KB
-
load_computation.R
4.68 KB
-
README.md
6.03 KB
Abstract
Adaptation is critical for biodiversity to persist under global change. Within ecological communities, species often face trade-offs between adapting to shifting abiotic conditions and navigating the complex selective pressures imposed by interaction networks. We hypothesize that network architectures characterized by high interaction diversity and overlap constrain coevolutionary dynamics, with asymmetric outcomes for exploiters and victims. Specifically, we predict that exploiters, subject to spread and conflicting selection imposed by their victims, will evolve more slowly and show reduced capacity to track victims’ evolutionary responses, with these constraints strongest for generalist exploiters. In contrast, victims will show more variable dynamics depending on the coherence of selection (i.e., whether pressures from different exploiters push the victim’s trait in the same vs. different directions). To test this, we simulated trait evolution in coevolving communities of exploiters and victims across 91 empirical networks, and in artificial networks designed to isolate specific structural effects. Our results show that higher connectance, species richness, nestedness, and centrality homogenize biotic effects and increase fluctuations in trait matching, ultimately weakening coevolutionary coupling. Under these conditions, exploiters face conflicting selection that slows evolution, whereas victims either benefit from aligned selection that accelerates evolution or are constrained by multiple pressures. Together, our findings suggest that network architecture plays a fundamental role in shaping coevolution and adaptation, and raises broader questions about its influence on eco-evolutionary processes in more complex and environmentally variable systems.
Dataset DOI: https://doi.org/10.5061/dryad.cfxpnvxmt
Article publication: 10.1002/oik.12357
Description of the data and file structure
All analyses can be reproduced using the R notebook files (.Rmd) provided in this repository. These notebooks implement the full workflow for computing network metrics and running simulations on both empirical and simulated networks.
Reproducibility notes
- Users do not need to modify these
.Rfiles to reproduce the analyses. - All packages and customized functions (
.Rfiles) are automatically loaded when running the corresponding.Rmdnotebooks. - If file paths are changed, the
source()calls in the.Rmdfiles may need to be updated accordingly.
R notebooks
The repository contains the following R Markdown files:
1_metrics_empirical_networks.Rmd
Computes network metrics on empirical ecological networks.2_simulation_empirical_networks.Rmd
Runs simulations on empirical networks using the computed metrics.3_metrics_simulated_networks.Rmd
Computes network metrics on simulated networks.4_simulation_simulated_networks.Rmd
Runs simulations on simulated networks.demonstration_compute_total_effects.Rmd
Demonstrates how total effects are computed within the framework.
Software and computational environment
All analyses were performed in R (version ≥ 4.0 recommended).
Required R packages
The notebooks rely on the following packages:
tidyverse(includingdplyr,tidyr,ggplot2)igraphbipartitereshape2ggpubrviridisgridveganpoweRlaw
Description of .rds files and workflow dependencies
The .rds files in this repository store serialized R objects used either as inputs or outputs of the analysis workflow. Below is a description of how .rds files are used in relation to each R Markdown notebook.
1. 1_metrics_empirical_networks.Rmd
Inputs:
antagonistic_networks.csv: Summary of empirical networks' metrics..txtfiles containing interaction data for each empirical network. These are found in theempirical_networks.zipfile.
Outputs:
df_network_metrics.rds: computed network metrics for empirical networks -> Used as Input in2_simulation_empirical_networks.Rmdand in3_metrics_simulated_networks.Rmd.plot_complexity_effects.rds,p_mod_nest_effects.rds,plot_degree_effects.rds: plots that will be used in2_simulation_empirical_networks.Rmdfor creating the final figures.
2. 2_simulation_empirical_networks.Rmd
Inputs:
.rdsfiles generated by1_metrics_empirical_networks.Rmd.
Outputs:
df_20replicates_22june2025_corrected.rdssimulation results on empirical networks.
3. 3_metrics_simulated_networks.Rmd
Inputs:
df_network_metrics.rdsgenerated by1_metrics_empirical_networks.Rmd.
Outputs:
df_metrics_simulated_nets.rds: computed metrics for simulated networks, used in4_simulation_simulated_networks.Rmd.
4. 4_simulation_simulated_networks.Rmd
Inputs:
df_metrics_simulated_nets.rdsfile generated by3_metrics_simulated_networks.Rmd.
Outputs:
df_15replicates_4apr2025dec_simnets.rds: simulation results on simulated networks.
5. demonstration_compute_total_effects.Rmd
No Inputs or Outputs.
Description of .R files (custom functions)
The repository includes several .R scripts containing custom functions used throughout the analysis workflow. These files are sourced within the .Rmd notebooks.
Functions.R
General simulation functions, including:- generation of bipartite networks based on trait matching and connectance
- construction of interaction matrices
- computation of interaction-mediated selection pressures (hosts and exploiters)
- simulation utilities for trait evolution and adaptation summaries
generate_network.R
Functions to generate networks from specified degree distributions (e.g., random, scale-free, nested), and to construct bipartite networks from expected degree sequences.load_computation.R
Functions to compute fitness (load) components for species, including:- abiotic load (distance from environmental optimum)
- biotic load (interaction-based mismatch)
- network load (heterogeneity of interaction partners)
compute_metrics_networks.R
Functions to process empirical networks and compute structural metrics, including:- removal of isolated species
- degree distributions and entropy measures
- centrality metrics (degree, betweenness)
- SVD-based complexity measures
compute_net_effects.R
Functions to compute total (direct and indirect) effects in networks using matrix inversion approaches, as well as derived measures such as Shannon entropy of effects.
Description of input data files
Data source
The empirical interaction data used in this study were obtained from:
Andreazzi, C. S., Thompson, J. N., & Guimarães Jr, P. R. (2017).
Network structure and selection asymmetry drive coevolution in species-rich antagonistic interactions.
The American Naturalist, 190(1), 99–115.
antagonistic_networks.csv: metadata describing the empirical networks used in the analyses. Each row corresponds to a network.
Variables:
- Network file: unique ID for each network
- match_name: ignore
- type1: type of interaction
- type2: type of interaction
- nvictim: number of victims in the network
- nexpl: number of exploiters in the network
- connectance: network connectance
Each .txt file represents a bipartite interaction matrix for a given network.
- Rows correspond to victims/hosts.
- Columns correspond to exploiters/consumers.
- Entries are binary (0/1):
1= interaction present0= no interaction
