Learn R Programming

gaiah

This is an R-package for performing Genetic And Isotopic Assignment using Habitat features.

Most of the package has been written by Eric C. Anderson. The methodology for assigning individuals using stable isotope was first written by Hannah Vander Zanden and colleagues. It was reimplemented here and is now efficient enough to do leave one out cross validation, etc. These parts of the code are in the file R/vander-zanden-appendix.R.

Installing

To install the development version from GitHub with the devtools package, you can:

devtools::install_github("eriqande/gaiah")

Vignettes?

In lieu of a vignette, we provide the full source code for our use of the gaiah package for a recent paper. See below.

Reproducing the results from Ruegg et al. (2017)

If you want to reproduce all the results from the paper “Genetic assignment with isotopes and habitat suitability (GAIAH), a migratory bird case study” in Methods in Ecology and Evolution you will have to get the gaiah package and then also clone the analysis repository from https://github.com/eriqande/gaiah-wiwa and then follow the instructions in that repository’s README.

Copy Link

Version

Install

install.packages('gaiah')

Monthly Downloads

194

Version

0.0.5

License

CC0

Maintainer

Eric C. Anderson

Last Published

April 27th, 2023

Functions in gaiah (0.0.5)

vza_rescale

Parametric bootstrap for rescaling a la the vander zanden appendix
wiwa_breed

a raster of the breeding range of Wilson's warbler
wiwa_habitat_unclipped

RasterLayer showing the MaxEnt habitat suitability model unclipped by the known breeding range
group_birds_by_location

Group bird isotope data by locations
vza_mean_and_var_rasters

calculate a raster of mean and variance of expected tissue isotopes from precip data and resampled regressions
vza_assign

assign posterior probability of origin for a bird in each cell in the raster
wrld_simpl

Simple map of the world
private_rescale

internal function for isotope machinations
%>%

Pipe operator
gaiah

gaiah: Genetic and Isotopic Assignment Accounting for Habitat Suitability
comboize

combine genetics, isotopes, and habitat raster with exponents as given
genetic_posteriors2rasters

Convert posteriors to particular genetic reporting groups into raster
genetic_regions

RasterStack showing the 6 genetic regions that Wilson's warblers may be assigned to
extract_isopredictions

Add the isomap prediction and sd in columns attached to the feather isotope data frame
comboize_and_fortify

prepare fortified output for multipanel plot
get_wrld_simpl

return the wrld_simpl data set from maptools
hpd_cumul

finds the cumulative posterior probability of each cell for HPD calculation
breeding_wiwa_genetic_posteriors

Posterior probs of genetic region origin from Leave-one-out cross validation for breeding WIWAs
isomap_job54152_prediction

Predicted isotope values from ISOMAP
min_hpd_inc_area_df

compute the minimum hpd inclusion area for all the birds in a rasterStack
min_hpd_inclusion_area

compute the smallest area of an HPD credible set that includes the true bird location
example_isotope_posteriors

Output of isotope_posterior_probs for two migrant birds.
migrant_wiwa_genetic_posteriors

Posterior probs of genetic region of origin for 926 WIWAs sampled during migration
breeding_wiwa_isotopes

Isotope values, latitude, longitude and more data from 357 breeding Wilson's warblers
great_circle_raster

return a raster of great circle distances (in km)
isotope_posterior_probs

compute posterior probabilities of origin given isotope values
isomap2raster

convert columns of an ISOMAP isoscape to a raster object
migrant_wiwa_isotopes

Isotope values and meta data for 688 migrating Wilson's Warblers