gl.diagnostics.sim: Comparing simulations against theoretical expectations

View source: R/gl.diagnostics.sim.r

gl.diagnostics.simR Documentation

Comparing simulations against theoretical expectations

Description

Comparing simulations against theoretical expectations

Usage

gl.diagnostics.sim(
  x,
  Ne,
  iteration = 1,
  pop_he = 1,
  pops_fst = c(1, 2),
  plot_theme = theme_dartR(),
  save2tmp = FALSE,
  verbose = NULL
)

Arguments

x

Output from function gl.sim.WF.run [required].

Ne

Effective population size to use as input to compare theoretical expectations [required].

iteration

Iteration number to analyse [default 1].

pop_he

Population name in which the rate of loss of heterozygosity is going to be compared against theoretical expectations [default 1].

pops_fst

Pair of populations in which FST is going to be compared against theoretical expectations [default c(1,2)].

plot_theme

User specified theme [default theme_dartR()].

save2tmp

If TRUE, saves any ggplots and listings to the session temporary directory (tempdir) [default FALSE].

verbose

Verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress log ; 3, progress and results summary; 5, full report [default NULL, unless specified using gl.set.verbosity].

Details

Two plots are presented comparing the simulations against theoretical expectations:

  1. Expected heterozygosity under neutrality (Crow & Kimura, 1970, p. 329) is calculated as:

    Het = He0(1-(1/2Ne))^t,

    where Ne is effective population size, He0 is heterozygosity at generation 0 and t is the number of generations.

  2. Expected FST under neutrality (Takahata, 1983) is calculated as:

    FST=1/(4Nem(n/(n-1))^2+1),

    where Ne is effective populations size of each individual subpopulation, m is dispersal rate and n the number of subpopulations (always 2).

Value

Returns plots comparing simulations against theoretical expectations

Author(s)

Custodian: Luis Mijangos – Post to https://groups.google.com/d/forum/dartr

References

  • Crow JF, Kimura M. An introduction to population genetics theory. An introduction to population genetics theory. 1970.

  • Takahata N. Gene identity and genetic differentiation of populations in the finite island model. Genetics. 1983;104(3):497-512.

See Also

gl.filter.callrate

Examples

## Not run: 
ref_table <- gl.sim.WF.table(file_var=system.file('extdata', 
'ref_variables.csv', package = 'dartR'),interactive_vars = FALSE)
res_sim <- gl.sim.WF.run(file_var = system.file('extdata', 
'sim_variables.csv', package ='dartR'),ref_table=ref_table,
interactive_vars = FALSE,number_pops_phase2=2,population_size_phase2="50 50")
res <- gl.diagnostics.sim(x=res_sim,Ne=50)

## End(Not run)

green-striped-gecko/dartR documentation built on Sept. 7, 2024, 4:15 a.m.