Data for: Colonization and extinction processes mediate environmental effects on the phylogenetic diversity of invertebrate communities
Data files
Mar 13, 2026 version files 112.59 KB
-
Data_input.zip
23.41 KB
-
Data_output.zip
44.30 KB
-
README.md
10.18 KB
-
Scripts.zip
34.70 KB
Abstract
Phylogeny offers a powerful framework for understanding mechanisms driving community assembly. Yet, most empirical studies in community phylogenetics rely on observational approaches. In this study, we explore how two important drivers of community assembly — habitat size and predator presence — shape species richness and phylogenetic relatedness of prey communities by altering colonization and extinction processes. Using bromeliad invertebrate communities as our study system, we combined surveys of natural communities with experiments that manipulated habitat size and predator presence. Colonization and extinction were isolated in separate experiments to test whether the effects of habitat size and predator presence differed across stages of community assembly. Following species-area theory, we expected larger habitats to increase species richness and, given the strong consumptive effects of the top predator (a damselfly larva), we expected species richness to decline in the presence of predators. Under a community phylogenetics framework, if traits mediating responses to these factors are phylogenetically conserved, we expect the phylogenetic structure of the community (i.e., relatedness) to have deterministic patterns along both gradients. Specifically, if habitat size functions as an environmental filter, small bromeliads would host phylogenetically clustered assemblages; alternatively, if it functions as a mediator for coexistence among close relatives, larger habitats would exhibit greater relatedness. Likewise, we expected the generalist top predators to increase relatedness when closely related taxa have shared defensive traits. As traits mediating community assembly may vary in their phylogenetic distribution across lineages, we also anticipated relatedness patterns to vary across taxonomic scales. We found a positive effect of habitat size on species richness, which was driven by colonization mechanisms. Habitat size also affected relatedness, but the direction depended on taxonomic scale, with positive relationships at broad scales and negative relationships at narrower scales. By contrast, predators reduced species richness through extinction mechanisms, although these effects were masked in natural communities by continuous replacement of individuals through colonization. Predator effects on relatedness were variable across taxonomic scales, suggesting the involvement of multiple traits at different phylogenetic depths. Together, our findings highlight the complex interplay between environmental factors and community assembly in structuring taxonomic and phylogenetic dimensions of diversity.
https://doi.org/10.5061/dryad.31zcrjdw7
Description of the data and file structure
We performed natural surveys and designed in situ experiments to isolate the effects of specific environmental variables on community diversity and differentiate their effects during colonization and extinction processes.
The focal environmental variables were habitat size and predator presence, and analyses were performed at different taxonomic scales.
This project used the aquatic bromeliad invertebrate community as the study system and was conducted in Pitilla Biological Station, Costa Rica. Any NA represents missing data.
Folder and file structure
The content is organized into three sections:
- Data_input.zip: contains
.csvand.txtfiles required to run the scripts, including community and environmental data from natural surveys and experiments, as well as species information and the species phylogenetic tree. - Scripts.zip: R scripts organized in sequential steps, used to calculate diversity metrics, fit statistical models, and estimate species traits and phylogenetic signal. Scripts include in-line comments describing the analytical workflow, including data inputs and outputs,s and notes on analytical choices where relevant.
- Data_output.zip: Data derived from scripts, formatted for analyses.
Internal structure of zipped folders
Data_input/
├── Colonization_experiment-bromeliad_data.csv
├── Colonization_experiment-community_data_long.csv
├── Extinction_experiment-bromeliad_data.csv
├── Extinction_experiment-community_data_long.csv
├── Species_data.csv
├── SpeciesTree-SpeciesPool.txt
├── Surveys-bromeliad_data.csv
└── Surveys-community_data-raw.csv
Scripts/
├── 0_Functions.R
├── 1_Data_prep.R
├── 2_Diversity_metrics.R
├── 3_Models.R
├── 3a_Alt_surveys.R
├── 4_Model_figures.R
└── 5_Phylogenetic_signal.R
Data_output/
├── Colonization_experiment-community_data.csv
├── Diversity_Metrics_Colonizing_Communities_Diptera.csv
├── Diversity_Metrics_Colonizing_Communities_Insects.csv
├── Diversity_Metrics_Colonizing_Communities_Invertebrates.csv
├── Diversity_Metrics_Extinction_Experiment_Diptera.csv
├── Diversity_Metrics_Extinction_Experiment_Insects.csv
├── Diversity_Metrics_Extinction_Experiment_Invertebrates.csv
├── Diversity_Metrics_Surveyed_Communities_Diptera.csv
├── Diversity_Metrics_Surveyed_Communities_Insects.csv
├── Diversity_Metrics_Surveyed_Communities_Invertebrates.csv
├── Extinction_experiment-community_data_end.csv
├── Extinction_experiment-community_data_start.csv
└── Surveys-community_data.cs
Description of files and variables
Folder: Data_input
File: Data_input/Colonization_experiment-bromeliad_data.csv
Description: Data on bromeliads in the colonization experiment
Variables:
- Bromeliad_id: Unique identifier for bromeliads
- Treatment: Predator treatment present/absent
- Size_group: Level of habitat size factor
- MC.ml: Maximum water capacity of bromeliad tank (ml)
- MC.log: Logarithm of maximum capacity
File: Data_input/Colonization_experiment-community_data_long.csv
Description: Community data in colonization experiment
Variables:
- Bromeliad_id: Unique identifier for bromeliads
- Revised_name: Morphospecies name
- Phylogeny_code: OTU code associated with morphospecies
- Abundance: Abundance for each morphospecies
File: Data_input/Extinction_experiment-bromeliad_data.csv
Description: Data on bromeliads in the colonization experiment
Variables:
- Bromeliad_id: Unique identifier for bromeliads
- Treatment: Predator treatment present/absent
- Size_group: Level of habitat size factor
- MC.ml: Maximum water capacity of bromeliad tank (ml)
- MC.log: Logarithm of maximum capacity
File: Data_input/Extinction_experiment-community_data_long.csv
Description: Community data in the extinction experiment
Variables:
- Bromeliad_id: Unique identifier for bromeliads
- Revised_name: Morphospecies name
- Phylogeny_code: OTU code associated with morphospecies
- Size_category: Size of invertebrates
- N.initial.estimate: Initial abundance per morphospecies (estimate)
- N.initial.rounded: Initial abundance per morphospecies (rounded)
- Total.found.in.bromeliad: Final abundance per morphospecies
- N.survive: Inferred individuals that survived the experiment
- N.extinct: Inferred individuals extinct in the experiment
- Extra: Additional individuals found in the bromeliad
File: Data_input/Species_data.csv
Description: Species taxonomic information
Variables:
- Phylogeny_code: Unique identifier for OTUs
- Species_name_[nickname]: Corresponding morphospecies name
- Class: Class rank
- Order: Order rank
- Family: Family rank
File: Data_input/SpeciesTree-SpeciesPool.txt
Description: Species tree for the invertebrate community
File: Data_input/Surveys-bromeliad_data.csv
Description: Data on bromeliads censused in natural surveys
Variables:
- bromeliad_id: Unique identifier for bromeliads
- bromeliad_species: Bromeliad identity
- AC.ml: Actual water found in bromeliad tank (ml)
- MC.ml: Maximum water capacity of the bromeliad tank (ml)
- MC.log: Logarithm of maximum water capacity
- Mecistogaster_number: Number of Mecistogaster modesta found in the bromeliad
- Mecistogaster_biomass_mg: Biomass of Mecistogaster modesta found in the bromeliad (mg)
- total_detritus: Total detritus found in the bromeliad (mg) - excluding large pieces (> 2cm2) still not decomposed
- total_detritus_log: Logarithm of total detritus
- detritus_residuals: Residuals of detritus ~ maximum water capacity
File: Data_input/Surveys-community_data-raw.csv
Description: Community data from natural surveys
Variables:
- bromeliad_id: Unique identifier for bromeliads
- Phylogeny_code: OTU codes associated with morphospecies
- Revised_name: Morphospecies name
- id_method: Method for OTUs assignment. S=sequencing. M=morphology (from photographs). I=inferred (from field identification).
- abundance: Abundance per morphospecies
Folder: Data_output
Files:
Data_output/Surveys-community_data.csv
Data_output/Colonization_experiment-community_data.csv
Data_output/Extinction_experiment-community_data_end.csv
Data_output/Extinction_experiment-community_data_start.csv
Description: Clean community data (wide format) for natural surveys, colonization experiment, and extinction experiment (initial and final communities), respectively.
Variables:
Each column represents a species and is marked by the OTU code.
Rows correspond to bromeliads with their unique identifier.
Information for each OTU code can be found in Data_input/Species_data.csv
Files:
Data_output/Diversity_Metrics_Surveyed_Communities_Invertebrates.csv
Data_output/Diversity_Metrics_Surveyed_Communities_Insects.csv
Data_output/Diversity_Metrics_Surveyed_Communities_Diptera.csv
Data_output/Diversity_Metrics_Colonizing_Communities_Invertebrates.csv
Data_output/Diversity_Metrics_Colonizing_Communities_Insects.csv
Data_output/Diversity_Metrics_Colonizing_Communities_Diptera.csv
Data_output/Diversity_Metrics_Extinction_Experiment_Invertebrates.csv
Data_output/Diversity_Metrics_Extinction_Experiment_Insects.csv
Data_output/Diversity_Metrics_Extinction_Experiment_Diptera.csv
Description: Bromeliad data for surveys and experiments as described in the input data, with additional information on diversity metrics for invertebrate, insect, and dipteran communities, respectively.
Variables:
- Species_Richness: Number of species per bromeliad
- Abundance: Total abundance per bromeliad
- PD: Faith's Phylogenetic Diversity
- NRI: Net Relatedness Index
- NTI: Net Nearest Taxa Index
- wNRI: Net Relatedness Index - abundance weighted
- wNTI: Net Nearest Taxa Index - abundance weighted
- Centered and scaled versions of metrics marked with the suffix "_scaled."
- In the extinction experiment, initial values are marked with the h suffix "_i", final values are marked with the h suffix "_f", and differences are marked with the suffix ._Δ"
Folder: Scripts
File: Scripts/0_Functions.R
Description: Functions used in model selection
File: Scripts/1_Data_prep.R
Description: Process raw community data to resolve taxonomic identifiers and format matrices for analyses.
File: Scripts/2_Diversity_metrics.R
Description: Estimates taxonomic and phylogenetic diversity metrics for local invertebrate communities across surveys and experimental datasets
File: Scripts/3_Models.R
Description: Fits and compares linear models testing the effects of habitat size and predator presence or biomass on taxonomic and phylogenetic diversity metrics across survey and experimental datasets
File: Scripts/3a_Alt_surveys.R
Description: Fits and compares linear models, testing the effects of habitat size, predator biomass, and detritus availability on community diversity metrics
File: Scripts/4_Model_figures.R
Description: Script used to create figures
File: Scripts/5_Phylogenetic_signal.R
Description: Script for estimation of trait metrics and phylogenetic signal
Code/software
All analyses were conducted in R (version 4.4. 0).
The scripts used to reproduce the analyses are provided in the scripts folder of this repository.
Running the scripts in numerical order reproduces the analyses and figures presented in the manuscript.
