Skip to contents

This function extracts the estimated ancestry coefficients of a specified geographic location from an object resulting from the function popmaps().

Usage

anc_extract(
  pop_raster_list = "",
  input_raster = "",
  input_locs = "",
  dec_lat = "",
  dec_long = ""
)

Arguments

pop_raster_list

An R object resulting from executing the function popmaps().

input_raster

An R RasterLayer object defining the geographic extent of the interpolation recorded in pop_raster_list.

input_locs

An R object (rows = total # empirical sites, columns = total # genetic axes + 3) with column 1: site name; column 2: decimal longitude; column 3: decimal latitude; column 4…column x: ancestry coefficients for genetic axis 1…genetic axis x. Function depends on this precise format – see example data hija_struc.

dec_lat

A float specifying the decimal latitude from which to extract estimated ancestry coefficients.

dec_long

A float specifying the decimal longitude from which to extract estimated ancestry coefficients.

References

Massatti R & Winkler DE. (2022) Spatially explicit management of genetic diversity using ancestry probability surfaces. Methods in Ecology and Evolution. http://dx.doi.org/10.1111/2041-210X.13902

Author

Rob Massatti

Examples

if (FALSE) { # \dontrun{
    ex_raster <- raster::aggregate(hija_raster,fact=16)  #Cells in embedded raster are aggregated to reduce computation time
    pp <- popmaps(input_raster=ex_raster,input_locs=hija_struc,empirical_pt_dist=5,num_sites=15,num_tested=4,popmod=-0.05,threshold=0,surface='G')
    anc_extract(pop_raster_list=pp, input_raster=ex_raster, input_locs=hija_struc, dec_lat=39.46522,dec_long=-110.9525)
} # }