Skip to content

Commit

Permalink
Readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
FredSaltre committed Apr 26, 2024
1 parent eac92eb commit 10d85ae
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 1 deletion.
Binary file modified .DS_Store
Binary file not shown.
21 changes: 21 additions & 0 deletions Environmental_Variables/Environmental_variables.m
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
program Environmental_variables
% developed by Frederik Saltre 26/04/2024
% The script is designed to compute the distance of each grid cell in a specified area to the nearest coast and the nearest river, as well as calculate a ruggedness index for each grid cell
% It includes data preparation, intensive calculations for distance and ruggedness, and sophisticated visualizations with geographical mappings.


%%=========================================================================
%% RETURN A RASTER WITH THE DISTANCE OF EACH GRIDCELL TO THE NEAREST COAST
%%=========================================================================
%Part 1: Distance to the Nearest Coast
%Data Loading: The script starts by loading a matrix from a text file that likely contains geographic or environmental data.
%Preparation: It prepares two sets of data: one for non-missing data points and one specifically for coastal data points.
%Distance Calculation: For each non-missing data point, it calculates the distance to the nearest coast using geographic coordinates. It uses a function to compute the distance between points on the Earth's surface and selects the minimum distance for each point.
%Result Storage: The calculated distances are stored in a matrix that matches the original grid's dimensions and then saved to a text file.

clear all, close all, clc,
mat=load('maskedHumantimingraster_v2.txt');[r,c]=size(mat);tr=160;xg=-179.5:1:179.5;yg=-89.5:89.5;xg2=[xg(:,tr:end),xg(:,1:tr-1)];yg=flipud(yg');
TF=isnan(mat);[row,col]=find(TF==0);nr=length(row);out=[row,col,nan(nr,3)];for i=1:nr;out(i,3:4)=[yg(row(i)),xg2(col(i))];end;
Expand Down Expand Up @@ -35,6 +45,11 @@
%%=========================================================================
%% RETURN A RASTER WITH THE DISTANCE OF EACH GRIDCELL TO THE NEAREST RIVER
%%=========================================================================
%Part 2: Distance to the Nearest River
%Data and Preparation: Similar to the coast distance calculation, it loads main river data and prepares matrices for calculation.
%Distance Calculation: For each grid cell, it calculates the distance to the nearest river in a similar manner to the coast distance calculation.
%Visualization and Saving: The results are visualized on a world map using MATLAB's mapping toolboxes, and the distance data is saved to a text file.

clear all, close all, clc,
rsys=load('worldmainrivers.txt');vrsys=unique(rsys(:,1));
hum=load('maskedHumantimingraster_v2.txt');TF=isnan(hum);[row,col]=find(TF==0);chum=nan(length(row),4);
Expand Down Expand Up @@ -84,6 +99,12 @@
%%=========================================================================
%% RETURN A RASTER WITH AN INDEX OF RUGGEDNESS FOR EACH GRID CELL WORLDWIDE
%%=========================================================================
%Part 3: Ruggedness Index Calculation
%Data Loading: This section loads elevation data from a NetCDF file, which contains latitude, longitude, and elevation data.
%Preparation: Adjusts the longitude data to match the grid orientation used in the previous calculations.
%Ruggedness Calculation: For each grid cell, it calculates the ruggedness based on elevation differences with its immediate neighbors. This involves computing the square of the difference in elevation between a cell and each of its eight neighbors, summing these squares, and then taking the square root of the total.
%Final Adjustments and Saving: Excludes areas covered by ice sheets or water bodies from the ruggedness calculation and saves the ruggedness data to a text file.

clear all, close all, clc,
mat.alt=ncread('elev.1-deg.nc','data');mat.lat=ncread('elev.1-deg.nc','lat');mat.lon=ncread('elev.1-deg.nc','lon');
mat.time=load('maskedHumantimingraster_v2.txt');tr=160;xg=-179.5:1:179.5;yg=-89.5:89.5;xg2=[xg(:,tr:end),xg(:,1:tr-1)];yg=flipud(yg');%fichier humain timing
Expand Down
Binary file added IceSheet&River_data/.DS_Store
Binary file not shown.
Binary file modified Models/.DS_Store
Binary file not shown.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,34 @@

Code associated to the paper "Environmental conditions shaped the patterns of initial expansion by anatomically modern humans" by Frédérik Saltré, Joël Chadœuf, Thomas Higham, Monty Ochocki, Sebastián Block, Ellyse Bunney, Bastien Llamas, and Corey J. A. Bradshaw

This code and these data reproduce the results in the paper

## Abstract:

The ability of our ancestors to switch food sources and to migrate to more favourable environments quickly enabled the rapid global expansion of anatomically modern humans beyond Africa as early as 120,000 years ago1. Whether this versatility was largely the result of environmentally determined processes1-4 or was instead dominated by cultural drivers, social structures, and interactions among different groups5 is unclear6. We developed a new statistical approach that combines both archaeological and genetic data to infer the most-likely initial expansion routes in Eurasia and the Americas. We then quantified the main differences in past environmental conditions between the most-likely routes and other potential (less-likely) routes of expansion. We established that, even though cultural drivers remain plausible at a finer scales, the migration corridors are predominantly constrained by a combination of particular regional environmental conditions, including the presence of a forest-grassland ecotone, changes in temperature and precipitation, and proximity to rivers.


## File/Folder descriptions:

Models: provides the (R and Matlab) code and data to infer the regional timing of initial human arrival and human movement pathways between seven sets of two locations each (i.e., a source and destination that represented the extremes of movement pathways across a continent)

Environmental_Variables: provide Matlab code and data to generate the distance to the nearest river, distance to cost and ruggedness layers used in the manuscript to run the statitical analyses.

Genetic_data: includes a total of 67,643 human mitochondrial control region sequences from Genebank (last accessed 28 May 2017, the last available update in the regions of interest)

IceSheet&River_data: provides the dataset (shapefiles) usedto genertae the layer of river and icesheet extent

Source_data: provides raw data and R/Matlab code to generate: Figures 1 & 2, FigS2 and S7, and Table S2

Statistical_analysis: provides the R/Matlab code to reproduce the Gloabl and Regional Ranomisation test
***************
Frederik Saltre, Flinders University, [email protected] April 2022
Contact:
Dr Frederik Saltre,
Research Fellow in Ecology
College of Science and Engineering
Flinders University
Adelaide, South Australia
e-mail: [email protected]
URL: http://GlobalEcologyFlinders.com

![Screen Shot 2022-04-19 at 4 08 06 pm](https://user-images.githubusercontent.com/46954120/163941558-54b18035-5a74-44a2-984f-da05da11d048.png)
Binary file modified Source_data/.DS_Store
Binary file not shown.

0 comments on commit 10d85ae

Please sign in to comment.