spatial.AD: Simulate admixture in continuous, 2-dimensional space

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/spatial.AD.R

Description

Simulate admixture dynamics with or without selection on a few loci. Although space matters for local density-dependent competition, mating and dispersal are random (uniform) with respect to space.

Usage

1
2
3
4
5
spatial.AD(minX ,minY, maxX, maxY, XY, Genotypes, 
						beta=0,sel=0, mid=0,  
						h=0, DM = matrix(0,ncol=3,nrow=3),
						sigmac, R, M, gens,
						immigrants=FALSE,plotgrowth=FALSE,m=0.10)

Arguments

minX, minY, maxX, maxY

Limits of the model space in x and y dimensions.

XY

Matrix of initial x,y coordinates of individual organinisms.

Genotypes

Matrix of genotypes of initial organisms. Each genotype should be coded as 0, 0.5, or 1 for the frequency of alleles derived from one parental population. Rows are organisms, columns are unlinked loci. The first four loci can cause fitness variation.

beta

Steepness of an environmental gradient affecting the first locus.

sel

Strength of environmental selection affecting the first locus.

mid

Midpoint of the environmental gradient affecting the first locus.

h

Selection on heterozygotes at the second locus.

DM

Matrix of 2-locus fitness values for the 3rd and 4th loci (see details).

sigmac

Local competition parameter: Standard deviation of Gaussian competition function.

R

Instantaneous growth rate of the Beverton-Holt model.

M

Determines the local carrying capacity of the Beverton-Holt (K = (R-1)*M).

gens

Number of generations to simulate.

immigrants

If FALSE, the model space is closed to immigration and all boundaries are reflecting. If TRUE, the model is open to immigrants from pure parental populations at each edge of the x-dimension. If TRUE, m controls the edge dynamic (see below).

plotgrowth

If TRUE, the population size at each generation will be plotted.

m

Immigration parameter. If immigrants=TRUE, any individual within m/2 of each edge in the x-dimension will be replaced by a pure parental genotype.

Details

For the DM incompatibility, the matrix of fitnesses is 3x3, with rows corresponding to the first DM locus and columns correspinding to the second DM locus. Entries are W[i,j], where i and j index genotypes 0, 1, and 2 at the first and second locus, respectively. See example.

Value

A list with

XY

The x,y coordinates of the diploid individuals in the final generation.

Genotypes

The genotypes of the diploid individuals (rows) in the final generation.

mothers

The genotypes of the successful mothers in the next-to-last generation (roughly, an "after selection" sample from that generation).

Author(s)

Benjamin M. Fitzpatrick

References

Fitzpatrick, B. M. Alternative forms for genomic clines. In review

See Also

See spatial.HZ for a version with limited dispersal and mating distances. The simulated data can be analyzed with Cline.fit, but the genotypes must be multiplied by 2.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## Not run: 	
# define space:
minX <- minY <- -3
maxX <- maxY <- 3
# 100 individuals randomly placed:
XY <- cbind(runif(100,minX,maxX),runif(100,minY,maxY)) 
# simulate secondary contact by sorting aling the x dimension and assigning parental genotypes on each side of the centerline:
XY <- XY[order(XY[,1]),]
Genotypes <- rbind(matrix(0,nrow=sum(XY[,1]<=0),ncol=10),matrix(1,nrow=sum(XY[,1]>0),ncol=10))
# competition parameters:
 sigmac <- 0.2; R <- 1.75; M <- 5

# selection, inlcuding heterozygote disadvantage at locus 2 and a DM incompatibility between 3 and 4:
beta <- 0
sel <- 0
mid <- 0
h <- 0.4
DM <- rbind(
c(0,0.2,0.4),
c(0,0.0,0.2),
c(0,0.0,0.0))

# simulate 10 generations, open to immigration:
G10 <- spatial.AD(minX,minY,maxX,maxY,XY,Genotypes,beta,sel,mid,h,DM,sigmac,R,M,gens=10,immigrants=TRUE)


## End(Not run)

HIest documentation built on May 2, 2019, 10:21 a.m.