DOI: 10.5281/zenodo.15056211
title: Data and code for "Rethinking Darwin's coral reef paradox and the ubiquity of 'marine oases'"

description: Data and code necessary to run the analyses, and reproduce the figures, tables and text results from Morais et al. 'Rethinking Darwin's coral reef paradox and the ubiquity of ‘marine oases’', Current Biology.

Compressed folders are:



Allen_coral_atlas: includes two .tiff files, each a 1-km resolution, rasterised buffer (0-5km, 5-10km) processed version of the Allen Coral Atlas 'coral habitat' (i.e., coral/algae + rock);

Book: includes a text version of Charles Darwin's 'The structure and distribution of coral reefs' book published in 1842;

Code: includes all R scripts and extra functions necessary to run the analyses, and reproduce the figures, tables and text results of the paper;

GEBCO_bat: includes a .nc file, a global gridded bathymetry dataset downloaded directly from the GEBCO repository;

In-situ: includes two .csv files, each a dataset of in-situ ocean water chlorophyll-a measurements from a paper (Valente et al 2019 Earth Syst. Sci. Data; and Davies et al 2018 Sci. Data);

MEOW: includes a shapefile with the Marine Ecoregions of the World downloaded directly from the UNEP-WCMC repository;

Primprod: includes four .csv files from two databases and an extra data compilation in this work. Together, these files encompass net primary productivity estimates for a wide variety of terrestrial, freshwater, estuarine and marine ecosystems, including coral reefs;

Outputs: empty folder where figures and tables will be generated;

Outputs_authors: as the name suggests, includes the Outputs as last generated from the uploaded code by the authors on 20 March 2025;

run.R: master script for running all scripts within the Code folder. Running this file automatically loads all data files and executes code that creates and saves figures and tables.


The individual R scripts included are as follows:



01_reading.R: reads Charles Darwin's 'The structure and distribution of coral reefs' using the docx file provided performs topic modelling based on Latent Dirichlet Allocation models. Outputs are not saved outside of the session.

02_aca_reef_modis.R: extracts chlorophyll-a values (Aqua-MODIS, from NASA Ocean Colour) from buffers of Allen Coral Atlas coral habitat distribution, uses GEBCO bathymetry to mask shallow pixels and save near-reef chlorophyll-a data in the coordinate format. Key processed data output.

03_prim_prod.R: consolidates and tidies cross-ecosystem data on net primary productivity from three databases, performs a Bayesian Generalised Linear Model to estimate NPP for key ecosystem types, including multiple comparisons informing the magnitude of differences between ecosystems. Plot and table outputs.

04_oligo_vs_meso.R: analyses global near-reef chlorophyll-a data extracted before, breaking it down by geographical realm and habitat (inshore and offshore); provides plots and indicators of chlorophyll-a concentration across the levels of the variables analysed, including a distribution contrast between chlorophyll-a near-reefs and across tropical oceans more broadly. Key figure and table outputs.

05_in-situ.R: consolidates and tidies in-situ chlorophyll-a data from two databases, extracts data near-reefs and performs a Bayesian Generalised Linear Model to estimate in situ chlorphyll-a for realms and habitats, including multiple comparisons informing the magnitude of differences. Figure output.

06_nutrients.R: extract the concentration of four key nutrients (nitrate, phosphate, iron and silicate) across near-reef cells and for tropical, contrasts ranges of concentration of each nutrient between near-reefs tropical oceans more broadly, including absolute ranges and bivariate density kernel distributions. Key figure outputs.

07_exclude_marginal.R: performs sensitivity analysis excluding provinces and ecoregions where coral reef distribution could in theory be influenced by the occurrence off non-reef habitats in marginal regions. Figure outputs.
description: This research is part and was funded by RAM’s Branco Weiss Fellowship Society in Science and PSL Junior Fellowship. This work was also supported by the National Science Foundation under Grant Number 2210200 (to SJB).