Open code
An implementation to determine minimum marine distances between coordinate points along coastlines.
Unlike measuring pairwise terrestrial distances, marine distances need to account for landmasses, which cannot be crossed. Marine distances are a crucial predictor in genetics to build isolation by distance models. These measure gene frequencies variation under increasing geographic distances.
When marine distances are plotted against pairwise genetic differentation levels, a linear relationship is expected. Here we provide a straightforward R script to determine minimum marine distances.
A high-resolution polygon representing global landmasses is converted into an infinite resistance surface. Minimum distances between sites are computed with a shortest path algorithm considering the (infinite) resistance of landmasses and null resistance throughout the marine surface.
The outcome of the following code is a matrix of pairwise distances, a figure to visualize if sites are well represented in the surface area and a figure depicting an example of a minimum marine distance.
High resolution polygon depicting the surface of the world (e.g., Global Self-consistent Hierarchical High-resolution Shorelines; https://www.ngdc.noaa.gov/mgg/shorelines/gshhs.html)
Assis, J., Castilho Coelho, N., Alberto, F., Valero, M., Raimondi, P., Reed, D., Serrão, E. A. (2013). High and Distinct Range-Edge Genetic Diversity despite Local Bottlenecks. PLoS ONE, 8(7), e68646.
Automatically download biodiversity records from iNaturalist, the most recognised citizen science initiative.
High-resolution marine data layers to model the distribution of species at global scales.