single.pop.demog: Simulation of demographic models for single populations.

View source: R/single_pop_demog_test.R

single.pop.demogR Documentation

Simulation of demographic models for single populations.

Description

Test for constant size, population expantion and bottleneck for single population (non hiersrchical).

Usage

single.pop.demog(
  nsims,
  Ne.prior,
  time.prior,
  gene.prior,
  observed,
  alpha = F,
  tol = 0.01,
  nval = 100,
  do.ABC = F,
  do.PCA = F,
  CV = F,
  mod = cbind(c(1, 0.001, 2), c(1, 0.1, 20)),
  path = path
)

Arguments

nsims

Total number of simulations per model.

Ne.prior

Data frame with the prior values for the Ne of each population.

time.prior

Data frame with parameter values for the priors of the time of demographic change of each population.

gene.prior

Data frame with parameter values for the priors of the mutation rate of each species.

observed

Observed summary statistics calculated for the empirical data.

alpha

logical. If TRUE all demographic chages are exponential. If FALSE sudden changes. Defaut is FALSE.

tol

Tolerance level of the ABC analysis. Ignored if do.ABC = FALSE. Defaut is 0.01.

nval

Number of validations for the cross-validation of the ABC. Ignored if do.ABC = FALSE. Default is 100.

do.ABC

logical. If TRUE ABC analysis is performed. Default is FALSE.

do.PCA

logical. If TRUE PCA of the observed against the simulated data is performed. Default is FALSE.

CV

logical. If TRUE cros-validation is performed. Defaut is FALSE

mod

3 x 2 matrix of multiplyer priors (unif: min, max) for ancestral population sizes for each model. Default: cbind(c(1,0.001,2),c(1,0.1,20)). First row: constant size; min 1, max 1. Secound row: expansion; min 0.001, max 0.1. Third row: bottleneck; min 2, max 20.

path

Path to the directory to write the simulations. Defaut is the working directory.

Details

This function will take the same inputs used in the codemographic simulations and test for demographic change for each population separatelly. This test could be usefull to select which populations will be included in the codemographic model and to optimize the prior distributions.


gehara/PipeMaster documentation built on April 19, 2024, 8:14 a.m.