Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/inbo/wmh-analysis

Analysis of migration patterns of western marsh harriers using GPS tracking data for Vansteelant et al. (2020)
https://github.com/inbo/wmh-analysis

analysis animal-movement animal-tracking biologging birds lifewatch oscibio r rstats

Last synced: about 2 months ago
JSON representation

Analysis of migration patterns of western marsh harriers using GPS tracking data for Vansteelant et al. (2020)

Awesome Lists containing this project

README

        

# Analysis of migration patterns of western marsh harriers using GPS tracking data

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4059204.svg)](https://doi.org/10.5281/zenodo.4059204)

## Rationale

This repository contains analysis code for the paper:

> Vansteelant WMG, Klaassen R, Strandberg R, Janssens K, T'Jollyn F, Bouten W, Koks BJ & Anselin A (2020) Western Marsh Harriers _Circus aeruginosus_ from nearby breeding areas migrate along comparable loops, but on contrasting schedules in the West African–Eurasian flyway. Journal of Ornithology 161, 953–965.

To study their migration patterns, the paper makes use of GPS tracking data of 3 breeding populations of _Circus aeruginosus_:

Shortname | Population | Tracked birds | Data collected by | Movebank study | Deposited data
--- | --- | --- | --- | --- | ---
**Belgian dataset** | Near the Belgium-Netherlands border in the provinces East Flanders (Belgium) and Zeeland (the Netherlands) | 4 | [Research Institute for Nature and Forest (INBO)](https//www.inbo.be) | [604806671](https://www.movebank.org/cms/webapp?gwt_fragment=page=studies,path=study604806671) | [Anselin et al. (2019)](http://doi.org/10.5281/zenodo.3532941)
**Dutch dataset** | In the province of Groningen (the Netherlands) | 2 | [Dutch Montagu’s Harrier Foundation](https://grauwekiekendief.nl/) | [922263102](https://www.movebank.org/cms/webapp?gwt_fragment=page=studies,path=study922263102) | [Koks et al. (2019)](http://doi.org/10.5281/zenodo.3552508)
**Swedish dataset** | In Southern Sweden | 4 | [Lund University](https://www.lunduniversity.lu.se) | [49909355](https://www.movebank.org/cms/webapp?gwt_fragment=page=studies,path=study49909355) | -

## Repo structure

The repository structure is based on [Cookiecutter Data Science](http://drivendata.github.io/cookiecutter-data-science/). Files and directories indicated with `GENERATED` should not be edited manually.

```
├── README.md : Description of this repository
├── LICENSE : Repository license
├── wmh-analysis.Rproj : RStudio project file
├── .gitignore : Files and directories to be ignored by git

├── data
│ ├── raw : Data used for this analysis
│ └── maps : Maps downloaded by scripts (ignored by git) GENERATED

├── reports
│ ├── figures : Figures generated by scripts (ignored by git) GENERATED
│ └── tables : Tables generated by scripts (ignored by git) GENERATED

└── src : Analysis scripts
└── resampling : Data resampling scripts
```

## Usage

### Packages

Run [`src/p1_loadPackages.R`](src/p1_loadPackages.R) to install and load all required packages.

### Analysis scripts

These scripts are available in [`src`](src) and can be used to reproduce all figures and analyses from the paper. They are intended to be run consecutively.

1. `p2a_analyses_read_processed_data.R`: read data files
2. `p2b_analyses_annotate&clean_processed_data.R`: clean data
3. `p3_Fig1A_Lat-vs-yday.R`: make figure 1A of the paper
4. `p3a_Fig1B&C.R`: make figures 1B and 1C
5. `p3b_FigS2_Wintering-fin.R`: make figure S2
6. `p4_wind-fin.R`: read wind data and calculate mean daily wind components
7. `p5_CompileData-PerTrip-PerID_TableS1&S9.R`: make table S1 and S9
8. `p6_Figure2&TablesS5-S6.R`: make table S5 and S6
9. `p6_TableS2.R`: make table S2
10. `p6a_TableS3_Long-diff-pops.R`: make table S3
11. `p6b_TablesS7&8_WindSelectivity_glmms&posthoc.R`: make table S7 and S8

### Side scripts

These scripts are helper scripts automatically loaded when running the main analysis scripts.

- `pt2pt_fxns.R`: functions to compute distance, duration and speed
- `sidescript_CalcDailyStats.R`: compute daily statistics
- `sidescript_CalcStopovers.R`: compute coordinates and duration of stopovers
- `sidescript_readDEM.R`: read and manipulate DEM for making maps
- `sidescript_readSwedes.R`: read Swedish dataset, make selection and manipulate data to match with `MH-resampled-23092017.csv`

### Resampling scripts

These scripts are available in [`src/resampling`](src/resampling) and were used to resample the raw GPS data for the Belgian and Dutch datasets stored in the [UvA-BiTS database](https://www.uva-bits.nl) to an hourly resolution. The resampled data are stored in `data`, so running this code is not required to replicate our analysis.

## Data

### Source data

Source data are available in [`data/raw`](data/raw).

#### annotation.csv

Annotated version of the Belgian and Dutch datasets. Wouter Vansteelant determined the start and end dates of migratory and non-migratory periods through expert interpretation of tracks in Google Earth.

Fields:

- `naam`: bird name
- `cycle`: migratory cycle (winter, spring, summer, autumn + year)
- `date`: starting date
- `type`: behaviour type (breeding, dead, migration, move, pre-migration, winter.stage1, winter.stage2, winter.stage3)
- `complete`: criterion for selection in analysis
- `use.date`: criterion for selection in analysis

#### annotation-swedes.csv

Annotated version of the Swedish dataset. Wouter Vansteelant determined the start and end dates of migratory and non-migratory periods through expert interpretation of tracks in Google Earth.

Fields: same as `annotation.csv`

#### MH-resampled-23092017.csv

Belgian and Dutch tracking data downloaded from the UvA-BiTS database on September 23, 2017 (also available on Movebank and Zenodo, see above).

Fields:

- `dev`: device code
- `name`: bird name
- `dt`: datetime
- `lat`: latitude
- `long`: longitude
- `alt`: altitude
- `date`: date component of `dt`
- `mth`: month
- `yr`: year
- `season`: spring/autumn
- `julian`: Julian date
- `yday`: day of year
- `indday`: combination of `name` and `julian`, thus providing a unique identifier for each bird-day
- `migr`: combination of `name`, `yr` and `season`, thus providing a unique identifier for each migratory trip
- `origin`: data provider
- `dist`: distance (calculated using `pt2pt_fxns.R`)
- `dur`: duration (calculated using `pt2pt_fxns.R`)
- `spd`: speed (`dist/dur`, calculated using `pt2pt_fxns.R`)
- `dist.b`: the distance between point i and i-1 (`dist` is from i to i+1)
- `dur.b`: the duration between point i and i-1 (`dur` is from i to i+1)
- `spd.b`: the speed between point i and i-1 (`spd` is from i to i+1)
- `high`: classifier marking records with unrealistically high speed values

#### swedes.csv

Swedish tracking data, obtained from Raymond Klaassen (also available on Movebank, see above).

Fields:

- `dev`: device code
- `lat`: latitude
- `long`: longitude
- `alt`: altitude
- `dtx`: date time rounded to an hour
- `dt`: date time
- `dif`: -
- `filter`: criterion for selection in analysis (1 = use, 0 = do not use)

#### weather.csv

Table containing wind parameters as extracted with RNCEP for the fixes obtained nearest to 6:00, 12:00 or 18:00 UTC on each day. These variables are used to estimate mean daily wind conditions analogous to [Klaassen et al. (2010)](https://doi.org/10.1111/j.1600-048X.2010.05058.x).

Fields:

- `dt`: datetime
- `date`: date component of `dt`
- `name`: bird name
- `indday`: combination of `name` and Julian date, thus providing a unique identifier for each bird-day
- `u`: u-component (i.e. zonal component) of the wind vector (positive values towards east, negative towards west)
- `v`: v-component (i.e. meridionaal component) of the wind vector (positive values towards north, negative towards south)
- `w`: wind strength
- `alfa`: wind direction (in degrees relative to north)
- `tag2`: label indicating whether this is a fix

### External GIS data

These data are downloaded by the scripts into [`data/maps`](data/maps) and are also available online:

- `ne_50m_admin_0_countries`: shapefile containing country boundaries, source: [Natural Earth](https://www.naturalearthdata.com/downloads/50m-cultural-vectors/50m-admin-0-countries-2/)
- `alt_30s_bil`: raster file containing a DEM of the world, source: [worldclim, version 1.4](http://biogeo.ucdavis.edu/data/climate/worldclim/1_4/grid/cur/alt_30s_bil.zip)

## Acknowledgements

This work makes use of data and/or infrastructure provided by INBO and funded by Research Foundation - Flanders (FWO) as part of the Belgian contribution to [LifeWatch](https://lifewatch.be).