Coala can call the coalescent simulators ms[1], msms[2] and scrm[3] and can use seq-gen[4] for finite sites simulations. The R version of scrm should get installed automatically as a dependeny of coala. For the other programs, you need to have an executable binary available on your system.
Short instructions on obtaining and compiling the programs are given in the help pages of activate_ms
, activate_msms
and activate_seqgen
. More detailed instructions are provided in the wiki.
In addition to providing the binary for a simulator, you need to inform coala
where the binary is. We refer to this process as activation of a binary. Afterwards, coala
will use the simulator automatically where-ever appropriate.
There are three different ways to activate a binary:
activate_msms
and activate_seqgen
functions to activate the simulators from within R. You should use the functions before creating a model.scrm
and ms
. scrm
should alawys be available. Install the CRAN package phyclust
to use ms
.Simulator | Priority | Expected Binary Names | Environment Var | Function |
---|---|---|---|---|
seq-gen | 100 | seqgen, seq-gen, seqgen.exe, seq-gen.exe | SEQGEN | activate_seqgen |
msms | 200 | msms.jar / java, java.exe | MSMS / JAVA | activate_msms |
ms | 300 | activate_ms | ||
scrm | 400 |
You can use the list_simulators()
command to view which simulators are currently available:
## name priority info
## 1 scrm 400 version : 1.7.4-0
## 2 seqgen 100 binary : /home/dirk/bin/seq-gen
The check_model
function checks which simulators support a specific model, and states the problems which coala has detected with the simulators that do not support it. For example, a simple model with infinite-sites mutations (IFS) can be simulated with scrm
or – if installed – with ms
and msms
, but not with seq-gen
because the latter generates finite-sites mutations:
model <- coal_model(10, 1) +
feat_mutation(5, model = "IFS") +
sumstat_nucleotide_div()
check_model(model)
## scrm : OK
##
## seqgen : Error : seq-gen can not simulate an IFS model
##
## Features:
## * Sampling of 10 (pop 1) individuals with ploidy 1 at time `0`
## * Mutations with rate `5` following a IFS mutation model
## * Generating Seg. Sites
##
## Parameter: None
##
## Loci: 1 locus of length 1000
##
## Summary Statistics: stat_pi
##
## Simulator: scrm
## Command: scrm 10 1 -t 5
If multiple simulators can simulate a model, the one with the highest priority is used. In our example, that is scrm
. If we would like to use ms
instead, we need to raise its priority: