DOI: 10.5061/dryad.k6djh9wgq
title: Differences in extinction selectivity and their relationship to functional traits in late Cenozoic molluscs

description: This repository contains all the data and code scripts to replicate the
 analyses of the paper: Differences in extinction selectivity and their
 relationship to functional traits in late Cenozoic mollusks. The data is a
 compendium of functional traits for various species of bivalves and
 gastropods from the Western Atlantic. Trait data were compiled for 105
 species—67 bivalves and 38 gastropods—from the late Cenozoic. For
 bivalves, six traits were recorded: feeding type, mobility, shell
 fixation, shell ornamentation, ridge morphology, and organism–substrate
 relationship. For gastropods, five traits were considered: feeding type,
 siphonal canal, varix, callus, and umbilicus. Additionally, three traits
 shared by both clades—life habit, shell composition, and basal metabolic
 rate—were analyzed across the full dataset.
description: # Differences in extinction selectivity and their relationship to
 functional traits in late Cenozoic mollusks
 [https://doi.org/10.5061/dryad.k6djh9wgq](https://doi.org/10.5061/dryad.k6djh9wgq) ## Files All files listed here can be found in **Project_functional_traits_extinction_selectivity.zip** ### **Data:**  * **shared_traits_dataset.csv:** Shared-traits between bivalves and gastropods. BMR: Basal metabolic rate. BMR data obtained from Strotz et al. (2018) and is measured in watts (W). Life habit and shell composition data obtained from the Paleobiology Database (PBDB) and associated references for this data are provided. Shell composition data for oysters (family: Ostreidae) was obtained from Checa et al. (2018), Hautmann (2006) and Stenzel (1964). * **shared_traits_alternative_version.csv:** Shared-traits dataset - alternative grouping. BMR: Basal metabolic rate. BMR data obtained from Strotz et al. (2018) and is measured in watts (W). Life habit and shell composition data obtained from the Paleobiology Database (PBDB) and associated references for this data are provided. * **bivalve_specific_dataset.csv:** Bivalve-specific traits dataset. BMR: Basal metabolic rate. Organism/Substrate Relationship - ER: Epifaunal recliner, EP: Epifaunal, SI: Semi-infaunal, IS: Infaunal siphonate, IA: Infaunal asiphonate, WN: Nestler on or within hard substrates, WB: Borer, nestling in hard substrate. Mobility - IM: Immobile, SE: Sedentary, MA: Actively mobile, and SW: Swimming. Feeding type - SU: Suspension feeder, DS: Surface deposit feeder, and DC: Chemosymbiotic deposit feeder. Shell fixation - UN: Unattached, BA: Bysally attached, and CE: Cemented. * **gastropod_specific_dataset.csv:** Gastropod-specific traits. BMR: Basal metabolic rate. Feeding type - CP: predatory carnivores, CB: browsing canivores, HM: herbivores on fine-grained substrates, HR: herbivores on rock, rubble or coral substrates, microalgivores, HP: herbivores on plant or algal substrates, micro-and macroalgivores and detritivores on macroalgal and seagrass substrates, SU: Suspension feeders. Missing vaues are labeled as 'undetermined'. * **bivalve_specific_dataset_alternative.csv:** Bivalve-specific traits dataset (alternative version). Bivalves-specific traits - alternative grouping. Feeding type and ridges morphology are re-classified in this version. Surface deposit feeders (labeled as "DS" in Dataset D) and chemosymbiotic deposit feeders (labeled as "DC" in Dataset D) were grouped into one category of deposit feeders, labeled as "DF" in this version. Ridges originally classified as “quasi-commarginal” in Dataset D were included in the “commarginal” category, and “quasi-radial” ridges were considered as “radial”. * **gastropod_specific_dataset_alternative.csv:** Gastropod-specific traits (alternative version). Feeding type is re-classified in this version. Predatory and browsing carnivores (CP and CB, respectively in Dataset E) are clumped into a single category of carnivores (C) in this table. Herbivores on fine-grained substrates (HM) and herbivores on plant or algal substrates (HP) were grouped into a single category of herbivores (H). Species with more than one feeding type were not included in these groups. Missing vaues are labeled as 'undetermined'. ### Code/software #### **Project.Rproj:** This is the R project where all the scripts, data files, figures/outputs, and history are stored in sub-folders. The working directory is the project's root folder. #### **.RData files:** All model outputs of this project are stored in`.RData` format. This versatile file type can be easily opened in R using the `readRDS()` function, as demonstrated in several scripts included in the project. Storing model outputs in this format facilitates reproducibility and replicability by allowing users to efficiently save, share, and retrieve model results. #### **Rproj.user folder** This folder is generated automatically during project setup and code execution and contains all the temporary files generated during the analysis. #### **R Scripts:** * **1. Multiple independence tests.R:** This script performs Chi-squared tests of independence to evaluate associations between categorical traits (trait–trait associations) as well as between traits and survival. The Benjamini–Hochberg procedure is applied to correct for multiple comparisons. * **1.1 Multiple independence tests.R:** This script performs Chi-squared tests of independence to evaluate associations between categorical traits (trait–trait associations) as well as between traits and survival, for the alternative versions of the bivalve-specific and gastropod-specific datasets. The Benjamini–Hochberg procedure is applied to correct for multiple comparisons. * **2. Binary Logistic Regression - Class random effect.R:** This code generates generalized mixed effects logistic regression models for the data in *shared_traits_dataset.csv*. This scripts considers different combinations of the shared traits among bivalves and gastropods (Life habit, basal metabolic rate, and shell composition). * **2.1. Binary Logistic Regression - Class random effect - BMR categorized.R:** Version of the code 2 applied to the data in *shared_traits_dataset.csv* treating BMR as a categorical variable. * **2.2. Binary Logistic Regression - Class random effect - life habit grouped.R:** Version of the code 2 applied to the data in *shared_traits_dataset.csv* while grouping 'boring' and 'semi-infaunal' species. * **2.3. Binary Logistic Regression - Class random effect - three shell composition levels.R:** Version of the code 2 applied to the data in *shared_traits_alternative_version.csv*. * **3. Binary Logistic Regression - bivalves only.R:** This code generates generalized mixed effects logistic regression models using only data for bivalves in *shared_traits_dataset.csv*. * **3.1 Binary Logistic Regression - bivalves only - BMR categorized.R:** This code generates generalized mixed effects logistic regression models using only data for bivalves in *shared_traits_dataset.csv*. BMR is treated as a categorical variable. * **3.2 Binary Logistic Regression - bivalves only - life habit grouped.R:** This code generates generalized mixed effects logistic regression models using only data for bivalves in *shared_traits_dataset.csv*. BMR is treated as a categorical variable. 'Boring' and 'semi-infaunal' species are grouped * **4. Binary Logistic Regression - gastropods only.R:** This code generates generalized mixed effects logistic regression models using only data for gastropods in *shared_traits_dataset.csv*. * **4. Binary Logistic Regression - gastropods only - BMR categorized.R:** This code generates generalized mixed effects logistic regression models using only data for gastropods in *shared_traits_dataset.csv*. BMR is treated as a categorical variable. * **5. Binary Logistic Regression - bivalves-specific.R:** This code generates generalized mixed effects logistic regression models for bivalve-specific traits (*bivalve_specific_dataset.csv* ). This script considers bivalve-specific traits initially found to be associated with survival in **1. Multiple independence tests.R.** * **5.1 Binary Logistic Regression - bivalves-specific - BMR categorized.R:** This code generates generalized mixed effects logistic regression models for bivalve-specific traits (*bivalve_specific_dataset.csv* ). This script considers bivalve-specific traits initially found to be associated with survival in **1. Multiple independence tests.R. **BMR is treated as a categorical variable. * **6. Binary Logistic Regression bivalves - Alternative dataset.R:** This code generates generalized mixed effects logistic regression models for the alternative dataset of bivalve-specific traits (*bivalve_specific_alternative_version.csv*). This script considers different combinations of the bivalve-specific traits initially found to be associated with survival in **1. Multiple independence tests.R.** * **7. Forest_plots.R:** This script summarizes the information of the best-performing logistic regression models into a forest plot. The Y-axis lists the different predictors in the best-performing models and the X-axis represents the magnitude of the log-odds ratios associated to each of these predictors. * **7.1 Forest_plots.R:** Version of the code 7 for bivalves in the shared-traits dataset * **7.2 Forest_plots.R:** Version of the code 7 for the bivalves-specific traits dataset. * **7.3 Forest_plots.R:** Version of the code 7 for the alternative version of the bivalves-specific traits dataset. * **8. Averaged_coefficient_estimates.R:** Calcualte model-averaged coefficients for each predictor in best-supported models for the shared-traits dataset. * **8.1 Averaged_coefficient_estimates_shared_traits_bivalves.R:** Version of the code 8 for bivalves in the shared-traits dataset. * **8.2 Averaged_coefficient_estimates_bivalves_specific.R:** Version of the code 8 for the bivalves-specific traits dataset. * **9. Unbalanced_samples_bootstrap_sensitivity_test.R:** This script tests if the original results are significantly different from the results expected from a balanced dataset (equal number of bivalves and gastropods in the shared-traits dataset). This code generates 100 bootstrap replicates of our data, each containing the 38 original species of gastropods and 38 randomly selected species of bivalves from the total pool of 67. Generalized mixed effects logistic regression models are performed for each of these data replicates and distributions are obtained for each of the predictors found to be statistically significant in the original models. Original coefficients of these predictors are compared to their corresponding distributions, produced from balanced datasets, to test if they are significantly different from the mean value of their corresponding random distribution.