遇见数据集

Defaunation reshapes the distribution of biomass of tropical wild mammals

收藏
Zenodo2026-05-19 更新2026-05-26 收录
官方服务:

资源简介:

This repository contains the data and the 13 R scripts for the analysis of wild mammal biomass loss and changes in community weighted means of body mass across tropical forests at 50x50km resolution. Important note: Due to data use agreements and copyright restrictions, only the input data required to run analyses from Script 07 onwards are provided in this repository. Data Folder Structure The Data/ folder contains all input data required to run the analyses. Due to data use restrictions, only the files needed for Scripts 08-13 are provided in this repository. Below is a description of each subdirectory: Data/Output/Abundance_Matrix/ Contains 20 CSV files with species abundance matrices) for each scenario and confidence interval. Each file represents a combination of scenario (Natural, IUCN_Historical, Hloss, Hunting, COMB) and statistical metric (Mean, lw95, up75, up95). These matrices are the aggregated input for biomass and CWM computations. Data/Output/Biomass_Matrix/ Contains 20 CSV files with biomass matrices derived from abundance matrices multiplied by species body mass. Files follow the same naming convention as abundance matrices and serve as input for total biomass calculations and supplementary tables. Data/Output/CWM/ Contains 5 CSV files with Community Weighted Mean (CWM) body mass values per grid cell. Includes CWM for all mammals combined and separately for each trophic guild: Herbivores, Carnivores, Omnivores, and Invertivores. These files are used for statistical analysis and map visualization. Data/Spatial/World/ Contains the World shapefile (World.shp with associated .shx, .dbf, .prj, .cpg) used as a basemap for generating global figures in scripts 10 and 11. The shapefile is projected to Mollweide CRS for consistency with all spatial outputs. Data/Traits/ Contains Density_Traits_Predictions.csv, which includes trophic guild classification and diet trait data for all mammal species. This file is required for computing guild-specific CWM values. Note: The individual species CSV files from Data/Output/Mammal_50x50_Abundances/ are not included in this Zenodo repository due to space constraints. However, these are not required to run Scripts 08-13, as all necessary data are already aggregated in the abundance matrices, biomass matrices, and CWM files provided. R Codes Folder Structure Note: Scripts 01-06 require external datasets (e.g., IUCN Red List species ranges, PHYLACINE natural ranges, Santini's population density models, and high-resolution spatial predictors) that cannot be shared publicly. However, these scripts are fully documented for transparency. Scripts 08-13 are fully runnable as they process intermediate outputs generated from previous steps and do not require restricted external data. Users interested in reproducing the full pipeline should request access to the restricted datasets from the respective data providers (IUCN, PHYLACINE, etc.) following their data use policies. 01_Prep_Data.R: Rasterizes tropical forest shapefile to 50x50 km grid and extracts spatial predictors (distance to hunters’ access points, travel time to major cities, human population density, stunting prevalence, NPP, livestock biomass, protected areas, countries ISO code, precipitation CV, NDVI) for population density and hunting impacts predictions. 02_Frac_Covers.R: Computes fractional cover of PNV (Potential Natural Vegetation) and current anthropogenic habitats at 50x50 km resolution. Processes forest, savanna, shrubland, grassland, wetlands, rocky areas, desert, and artificial habitats 03_Mammal_Ranges.R: Extracts present natural ranges (PHYLACINE), current IUCN ranges, and IUCN ranges with extinct polygons for tropical mammals at 50x50km resolution. Processes species name crosswalks, handles taxonomic discrepancies between datasets, rasterizes distribution polygons, and creates individual CSV files per species with presence/absence data. 04_Hunting_Impacts.R: Hunting impacts on tropical mammals using hurdle models (binomial + Gaussian), validates model independence via residual correlation and covariance, rescales predictors and generates predictions for each species across its historical and current ranges, including uncertainty per species per grid cell. 05_Dens_Predictions.R: Population densities for tropical mammals using Santini's GAMM model for projecting density estimates (log10 and natural log scales) across species ranges, including uncertainty per species per grid cell. 06_Suitable_Cover_Estimation.R: Extracts suitable habitat preferences and elevation ranges for each mammal species via IUCN Red List API in parallel. Computes Area of Habitat (AOH) by summing fractional covers of suitable PNV and current habitat types, applies elevation filters, aggregates to 50x50km resolution, and integrates results into species presence dataframes. Handles errors and reprocesses missing species. 07_Abundance_Estimation.R: Propagates uncertainty from three models (hunting impact models and population density models) using delta method (analytical and derivative approaches). Calculates abundances per grid cell (multiplying by 2500 km² and suitable habitat fraction) for the five scenarios. Computes mean abundances with 95% confidence intervals. 08_Biomass_Species.R: Converts abundances to biomass per species across five scenarios. Creates spatial biomass matrices (3785 species × grid cells) for each scenario and confidence interval. Summarizes biomass by order, realm (Neotropical, Afrotropical, Indomalayan, Pantropical), and scenario. Generates stacked bar plots and calculates percentage changes between scenarios. 09_CWM_Computation.R: Computes Community Weighted Mean (CWM) body mass for each grid cell across five scenarios. Creates abundance matrices (3785 species × grid cells), calculates relative abundances, multiplies by species body mass, and sums to obtain CWM. Disaggregates analyses by trophic guild (Herbivores, Carnivores, Invertivores, Omnivores). Computes deltas between Combined and Baseline scenarios. Outputs CWM rasters for all mammals and each trophic guild separately. 10_CWM_Results.R: Generates statistical summaries and visualizations of CWM results. Calculates summary statistics (mean, median, quantiles, SD) for baseline and defaunated scenarios across realms. Performs paired Wilcoxon tests to compare scenarios. Creates global maps of relative change (ΔCWM) for all mammals and by trophic guild using Mollweide projection. Produces density distribution plots comparing baseline vs COMB scenarios across guilds. 11_Biomass_Results.R: Computes total biomass estimates for baseline and anthropogenic scenarios. Calculates relative changes (Δ) and confidence intervals for biomass loss across realms. Disaggregates contributions of habitat loss vs overhunting as drivers of defaunation. Generates global biomass distribution maps and identifies top-10 contributing species per realm. Creates figures comparing baseline, habitat loss, hunting, and combined scenarios for tropical forests. 12_Supp_Tables_CWM.R: Generates supplementary tables for CWM (Community Weighted Mean) body mass analysis. Produces five tables: (1) CWM distribution statistics across scenarios and realms, (2) Deltas between baseline and defaunation scenarios (HL, OH, COMB) using both PHYLACINE and IUCN baselines, (3) Comparison between overhunting and habitat loss scenarios, (4) CWM distribution by trophic guild across scenarios and realms, (5) Relative changes in CWM by trophic guild. Includes Wilcoxon signed-rank tests with significance levels. Exports tables as Excel and CSV files for manuscript supplementary materials. 13_Supp_Tables_Biomass.R: Generates supplementary tables for biomass analysis. Produces three tables: (6) Total biomass across the tropics and realms per scenario (mean, 75% CI, 95% CI), (7) Deltas and statistical differences in biomass across scenarios using both PHYLACINE and IUCN baselines, (8) Comparison between overhunting and habitat loss scenarios for biomass loss. Includes Wilcoxon signed-rank tests with significance levels. Exports tables as Excel and CSV files for manuscript supplementary materials. System requirements Hardware: - Minimum RAM: 32 GB (your system has 36 GB, which is adequate) - Recommended RAM: 64 GB for running scripts 04-07 in parallel without memory swapping - Storage: 50 GB free space (for intermediate raster files and species-level abundance matrices) - CPU: 8+ cores (your Apple M3 Pro has 12 physical cores / 12 threads) *The analysis was developed and tested on a Mac laptop with Apple M3 Pro (12 cores, 36 GB RAM).* Software dependencies - R version: 4.4.0 or higher (tested on 4.4.0) - RStudio (optional) Performance note Scripts 1-07 use parallel processing across species. On the Apple M3 Pro (12 cores, 36 GB RAM): Scripts 01-07 (full pipeline with restricted data): > 5 days Scripts 08-13 (provided data only): 30-1 hour R Packages used: Data Manipulation & Transformation dplyr for data frame manipulation, filtering, joining and summarising data.table for high-performance data manipulation and fast file I/O tidyr for data reshaping and tidying tibble for data frame structure and consistent output stringr for string manipulation and pattern matching readr for fast reading and writing of CSV files readxl for importing Excel files (.xlsx, .xls) writexl for exporting data frames to Excel format scales for data scaling, transformation and axis formatting Spatial Analysis & GIS terra for raster and vector spatial data manipulation, projections, aggregations and extraction sf for vector spatial data handling and GIS operations mapview for interactive visualization of spatial data raster for legacy raster operations (older code sections) Statistical Modeling glmmTMB for generalized linear mixed models in hunting impact predictions mgcv for Generalized Additive Models (GAM) in density predictions Parallel Processing foreach for parallel loop construction doParallel as backend for parallel execution across multiple CPU cores parallel for core parallelization functions (detectCores, cluster creation) Data Visualization ggplot2 for publication-quality graphics and custom plotting ggpubr for arranging multiple plots and adding statistical annotations ggtext for enhanced text formatting (markdown, HTML) in ggplot2 API & Web Services rredlist for interface to IUCN Red List API iucnredlist for alternative IUCN API client for species assessments Utilities & Performance matrixStats for fast row/column-wise matrix operations openxlsx for reading and writing Excel files with formatting tictoc for execution time measurement and performance profiling tools for file path manipulation To install R packages, run the following code in R: install.packages(c("dplyr", "data.table", "tidyr", "tibble", "stringr", "readr", "readxl", "writexl", "scales", "terra", "sf", "raster", "glmmTMB", "mgcv", "foreach", "doParallel", "parallel", "ggplot2", "ggpubr", "ggtext", "rredlist", "iucnredlist", "matrixStats", "openxlsx", "tictoc", "tools"))

提供机构:
Zenodo
创建时间:
2026-05-07
二维码
社区交流群
二维码
科研交流群
商业服务