Source Code and Supplementary Material for: A Guide to Pre-processing High-throughput Animal Tracking Data
This is source code for a manuscript that sets out a pipeline for pre-processing data from ATLAS systems, but which can be applied to any high-throughput tracking data.
The worked out examples mentioned in the manuscript and provided in the supplementary material as a PDF, can also be found hosted on Github Pages in its online version, here: Online Version of Worked-out Examples.
Most of the source code may be found in the folder scripts
, with numbers indicating the order in which it is to be run.
This source code (for figures 7 and 8) is partially generated from the .Rmd
files in the directory supplement
using knitr::purl
.
See the render_books.sh
file for details of the conversion from .Rmd
to .R
.
Settings to store and restore the R packages to the versions used in this project.
-
01_background.R: Simulating data using the
R
packagesmoove
for the section Pipeline Overview, Gettingatlastools
, and Simulating Data. Simulated data is saved into thedata
folder asdata_sim.csv
(uniform correlated velocity model data), anddata_for_patch.csv
(three rotational/advection correlated velocity model datasets). No seed was set fordata_sim.csv
, butdata_for_res_patch.csv
was generated using a set seed. -
02_filtering_data.R: Source code for figures that support the sections Spatio-Temporal Filtering and Filtering to Reduce Location Errors. Also adds error to the UCVM dataset (
data_sim.csv
) using functions defined inR/helper_functions.R
. Makes Figures 2 -- 3. Writes cleaned data todata/data_no_reflections.csv
. -
03_smoothing_tracks.R: Code to make Figures 4 -- 5 in the section Smoothing and Thinning Data.
-
04_residence_patch.R: Code to make Figure 6 in the section Creating System-Specific Pre-processing Tools.
-
05_calibration_data.R: Code for Figure 7 in the main text subsection A Real-World Test of User-Built Pre-Processing Tools. Shows a fully worked out example of pre-processing ATLAS data, as well as the linear model validating the residence patch method. Also used in Supplementary Material 01 (
docs/ms_atlas_preproc_supplementary_material_DATE.pdf
) section Validating the Residence Patch Method with Calibration Data. -
06_bat_data.R: Shows a fully worked out example of pre-processing ATLAS tracking data from fruit bats in the Hula Valley, Israel, which forms the main text section Worked out Example on Animal Tracking Data. Also used in Supplementary Material 01 (
docs/ms_atlas_preproc_supplementary_material_DATE.pdf
) section Processing Egyptian Fruit Bat Tracks. -
0x_get_srtm_hula.py`: Python code to retrieve Shuttle Radio Topography Mission 30m resolution data for the Hula Valley, Israel. This is used solely as a background for Figure 8 in the main text.
-
helper_functions.R: Script with helpful functions to simulate errors in data.
The main text is also copied from a local source into the docs/
as a PDF.
Supplementary Material 01 is rendered into the docs/
folder as docs/ms_atlas_preproc_supplementary_material_DATE.pdf
, where DATE
is the date of rendering.
The rendering code using the R
package bookdown
is run from the shell script render_books.sh
.
This material is placed in the supplement/
folder.
-
figures/
The supplementary material figures. -
latex/
and*.yml
Formatting options for the supplementary material output. -
.Rmd
files to create the supplementary material. -
render_books.sh
: A shell script with helper commands to generate the Supplementary Material and the source code asR
scripts from theRmd
files. -
references.bib
: References for the main text and Supplementary Material 01.
The xx_references.Rmd
file ensures a References section in Supplementary Material 01.
Supplementary Material 02 is the PDF manual for the R
package atlastools
, which is rendered from the installed version of atlastools
using devtools::build_manual
.
The rendered output is atlastools_VERSION.pdf
.
Versioning is not implemented in the naming.
This command is also run from the shell script render_books.sh
.
-
atlas_best_practices.qgz
: A QGIS 3 project file to generate Figure 8 in the main text. -
.git*
: Files for git repository organisation. The submoduleatlas-manuscript
contains theTEX
source of the main text and is private.
The data/
folder contains the following main datasets.
-
data_sim.csv
: Data simulated fromR/_01_background.R
. An UCVM track simulated usingsmoove
. -
data_for_res_patch.csv
: Data simulated fromR/_01_background.R
. Three RACVM tracks simulated usingsmoove
.
-
atlas1060_allTrials_annotated.csv
: A hand held calibration ATLAS track collected in August 2020 in the Dutch Wadden Sea. Used to make Figure 7 in the main text subsection Validating the Residence Patch Method, and in Supplementary Material 01 (docs/ms_atlas_preproc_supplementary_material_DATE.pdf
), section Validating the Residence Patch Method with Calibration Data. -
Three_example_bats.sql
: Tracks from three Egyptian fruit bats (Rousettus aegyptiacus)from the Hula Valley, Israel. Used to make Figure 8 in the main text section Worked out Example on Animal Tracking Data, and for the Supplementary Material 01 (docs/ms_atlas_preproc_supplementary_material_DATE.pdf
) section Processing Egyptian Fruit Bat Tracks. -
bat_data.csv
: The above data saved as acsv
file.
-
griend_polygon/
: A shapefile with the polygon outline of the Dutch Wadden Sea island of Griend, where the calibration data was collected. -
hula_valley/
: A shapefile of the extent of the study site of the Hula Valley, Israel. -
griend_hut.gpkg
: The location of the field station on Griend. -
Roosts.csv
: The locations of bat roosts in the Hula Valley. -
trees_update_clusters_Aug2020.csv
: The locations of fruit trees in the Hula Valley, Israel. -
srtm_30.tif
: A digital elevation model (DEM) of the Hula Valley, Israel.
All other data are processed forms of the simulated or empirical movement data and not described further.
The figures folder contains the main text, as well as supplementary material figures.