SimEvo performs a simulation of shape variation using a modification of Lande's evolutionary model Polly 2004
Usage
SimEvo(vari, consensusvec, resids, ngen, fsamp)
Arguments
vari
Variation coefficient
consensusvec
Consensus shape (vectorized form)
resids
GPA residuals matrix
ngen
Number of generations of simulations (Default: 1000000 steps).
fsamp
Frequency of samples (Default: 1000000 steps).
Details
Lande's evolutionary model defines mean morphological variation over generations Δ Z as:
Delta Z = beta*G
where G is the additive genetic covariance matrix, and β are selection coefficients applied to the morphological structure.
Polly 2004 proposes a modification of this equation in order to use it with morphological data instead of genetic data:
Delta Z = beta*H*P
where P is the phenotypic covariance matrix, and H is an heritability matrix (See Polly 2004 for more information).
resids will be used as the phenotypic covariance matrix, and vari will be used to simulate β H term. After ngen simulations steps the new shape will be
reconstructed from the starting shape consensusvec .
The number of plots representing the new shapes can be modify using fsamp .
Value
It returns a list of ngen/fsamp shapes (landmarks coordinates)
Author(s)
Cabrera Juan Manuel
References
Polly, P. D. (2004). On the simulation of the evolution of morphological shape: multivariate shape under selection and drift. Palaeontologia Electronica, 7(2), 1-28.
Examples
data("aegla_landmarks")
#Use GpaResiduals function to obtain GPA residual matrix and consensus
# coordinates from landmark configuration
a_data=GpaResiduals(aegla_landmarks)
#Simulate morphological evolution with a variation rate "vari"
# trough "ngen" generations and retrieve the last generation shape coordinates
simshape = SimEvo(vari = 2, consensusvec = a_data$cvectorized,
resids = a_data$resid, ngen = 10000, fsamp = 10000)
#Plot consensus shape and the simulated shape
par(mfrow=c(1, 2))
plot(a_data$consens,type = "p",main = "Reference", xlab = "", ylab = "")
plot(simshape[[1]],type = "p",col = "red",main = "Target", xlab = "", ylab = "")
#Or you can use PlotVariations to see the difference more clearly
PlotVariations(simshape,a_data$consens)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(Evomorph)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/Evomorph/SimEvo.Rd_%03d_medium.png", width=480, height=480)
> ### Name: SimEvo
> ### Title: Simulation of Shape Variation
> ### Aliases: SimEvo
>
> ### ** Examples
>
> data("aegla_landmarks")
>
> #Use GpaResiduals function to obtain GPA residual matrix and consensus
> # coordinates from landmark configuration
>
> a_data=GpaResiduals(aegla_landmarks)
[1] "Gpa coordinates not provided. Using gpagen from geomorph..."
>
> #Simulate morphological evolution with a variation rate "vari"
> # trough "ngen" generations and retrieve the last generation shape coordinates
>
> simshape = SimEvo(vari = 2, consensusvec = a_data$cvectorized,
+ resids = a_data$resid, ngen = 10000, fsamp = 10000)
>
> #Plot consensus shape and the simulated shape
>
> par(mfrow=c(1, 2))
> plot(a_data$consens,type = "p",main = "Reference", xlab = "", ylab = "")
> plot(simshape[[1]],type = "p",col = "red",main = "Target", xlab = "", ylab = "")
>
> #Or you can use PlotVariations to see the difference more clearly
>
> PlotVariations(simshape,a_data$consens)
[[1]]
>
>
>
>
>
>
> dev.off()
null device
1
>