Wiki

Clone wiki

ApproxWF / Simulate Trajectories (task simTrajectories)

Simulate Trajectories (task simTrajectories)

Wright-Fisher Parameters

When using task=simTrajectories, ApproxWf will simulate trajectories. For this, all Wright-Fisher parameters N, s, h and f must be specified (check here for details on those parameters).

There are three options to choose when to stop the simulation:

  • by default, ApproxWF simulates trajectories until the allele is either fixed or lost.
  • if given, the argument fend will make simulations run only until the frequency specified by fend is reached (works from both directions, depending on f), or the allele is either fixed or lost.
  • if given, the argument maxGen limits the number of generations of the simulations.

Output files

For each simulated trajectory, some statistics are written to a file ending with _statistics.txt. This file contains one row per simulated trajectory with the following columns:

  • N: the population sizes used in the simulation
  • s: the selection coefficient used in the simulation
  • h: the dominance coefficient used in the simulation
  • f_init: the initial frequency used in the simulation
  • f_end: the frequency at the end of the simulation
  • T: the number of generations passed until the simulations ended

By default, the actual trajectories are not printed. In order have them printed, provide the argument writeTrajectories.

The prefix of the output files can be specified with the argument outName.

Choosing the Approximation

Simulations can be performed with multiple approximations, and the preferred one is specified with the argument type. The following tags are accepted:

  • WrightFisher to use the discrete Wright-Fisher model. This corresponds to not using any approximation.
  • Kimura to use the classic Kimura diffusion approximation
  • Lacerda to use a more accurate diffusion approximation as proposed by Lacerda & Seoighe (2014)
  • Ferrer to use the mean transition time approximation introduced in our paper Ferrer-Admetlla et al. (2016)
  • Malaspinas to use the approximation proposed by Malaspinas et al. (2012).

Other arguments

Several replicates can be generated at once by using the argument rep.

Updated