Menu

HaploidSimulations

Robert Kofler Christos Vlachos

1 Introduction

In this walkthrough we show how to simulate evolution of haploid organism. We show minimal simulations and simulations with recombination and selection.

2 Minimal simulations with haploid organism

In this toy example we demonstrate minimal simulations with haploid organism. Solely the haplotypes of the not evolved base population are required

haploid base population

2L  1   G   A/T A T A A A A A A A A A A A A A A A A A T
2L  2   G   A/T A T A A A A A A A A A A A A A A A A A T
2L  3   G   A/T A T A A T A A A A A A A A A A A A A A T
2L  4   G   A/T A T A A T A A A A A A A A A A A A A A T
2L  5   G   A/T A T A A T A A A A A A A A A A A A A A T
2L  6   G   A/T A T A A T A A A A A A A A A A A A A A T
2L  7   G   A/T A T A A T A A A A A A A A A A A A A A T
2L  8   G   A/T A T A A T A A A A A A A A A A A A A A T
2L  9   G   A/T A T A A T A A A A A A A A A A A A A A T
2L  10  G   A/T A T A A T A A A A A A A A A A A A A A T

neutral simulations

We perform neutral simulations for 20 generations.

Note the flag --haploid is absolutely necessary! If not provided diploid simulations would be performed, where the genotypes of the base population would be interpreted as homozygotes (e.g. A would be interpreted as AA and T as TT).

mkdir output
java -jar mim2.jar w --haplotypes-g0 basepop.mimhap --snapshots 20 --output-dir output --haploid

evolved haplotypes

With the command gzip -cd output/haplotypes.r1.g20.mimhap.gz we may display the evolved haplotypes

2L  1   G   A/T T A A A A T A A A A A A A A A A A A A A
2L  2   G   A/T T A A A A T A A A A A A A A A A A A A A
2L  3   G   A/T T A A A A T A A A A A A T A A A A A A A
2L  4   G   A/T T A A A A T A A A A A A T A A A A A A A
2L  5   G   A/T T A A A A T A A A A A A T A A A A A A A
2L  6   G   A/T T A A A A T A A A A A A T A A A A A A A
2L  7   G   A/T T A A A A T A A A A A A T A A A A A A A
2L  8   G   A/T T A A A A T A A A A A A T A A A A A A A
2L  9   G   A/T T A A A A T A A A A A A T A A A A A A A
2L  10  G   A/T T A A A A T A A A A A A T A A A A A A A

3 Simulations with recombination and selection

For this walkthrough we use the same base population as in the previous example.
Additionally we specify a selected locus and recombination.

selected loci for haploid organism

We store the following content in the file sellocus.txt

[w]
2L  5   A/T 1.0 100.0   1.2

The file format is the same as for diploid organism; see [SelectedLoci]
With haploid organism however the heterozygous genotypes are ignored (in this case the ridiculously high fitness of 100.0).
The fitness of the haploid A is identical to the diploid AA and the fitness of the haploid T is identical to the fitness of the diploid TT

  • w_A = w_AA = 1.0
  • w_T = w_TT = 1.2

recombination rate for haploid organism

We store the following content in file recrate.txt

[lambda]
2L:1..10    1

start the simulations

mkdir output
java -jar mim2.jar w --haplotypes-g0 basepop.mimhap --snapshots 5,10,20,30,40,50 --output-dir output --haploid --recombination-rate recrate.txt --fitness sellocus.txt

output haplotypes

generation 20
At generation 20 the beneficial allele at position 5 is still segregating

2L  1   G   A/T T T T T T T T T T T T T T T T T T T T T
2L  2   G   A/T T T T T T T T T T T T T T T T T T T T T
2L  3   G   A/T A A T A A A A A A A A A A T T A A A A A
2L  4   G   A/T A A A A A A A A A A A A A A A A A A A A
2L  5   G   A/T T A A T A A T A A A T A T A A T A T T T
2L  6   G   A/T A A A A A A A A A A A A A T A A A A A A
2L  7   G   A/T A A A A A A A A A A A A A A A A A A A A
2L  8   G   A/T A A A A A A A A A A A A A A A A A A A A
2L  9   G   A/T A A A A A A A A A A A A A A A A A A A A
2L  10  G   A/T A A A A A A A A A A A A A A A A A A A A

generation 30
At generation 30 the beneficial allele at position 5 got fixed

2L  1   G   A/T T T T T T T T T T T T T T T T T T T T T
2L  2   G   A/T T T T T T T T T T T T T T T T T T T T T
2L  3   G   A/T A A A A A A A A A A A A A A A A A A A A
2L  4   G   A/T A A A A A A A A A A A A A A A A A A A A
2L  5   G   A/T T T T T T T T T T T T T T T T T T T T T
2L  6   G   A/T A A A A A A A A A A A A A A A A A A A A
2L  7   G   A/T A A A A A A A A A A A A A A A A A A A A
2L  8   G   A/T A A A A A A A A A A A A A A A A A A A A
2L  9   G   A/T A A A A A A A A A A A A A A A A A A A A
2L  10  G   A/T A A A A A A A A A A A A A A A A A A A A

4 Sex and haploid organism

MimicrEE2 supports the simulation of sex for haploid organism.

haploid base population with sex

We store the following in file basepop.mimhap

#sex                M F M F M F M F M F M F M F M F M F F F
2L  1   G   A/T A T A A A A A A A A A A A A A A A A A T
2L  2   G   A/T A T A A A A A A A A A A A A A A A A A T
2L  3   G   A/T A T A A T A A A A A A A A A A A A A A T
2L  4   G   A/T A T A A T A A A A A A A A A A A A A A T
2L  5   G   A/T A T A A T A A A A A A A A A A A A A A T
2L  6   G   A/T A T A A T A A A A A A A A A A A A A A T
2L  7   G   A/T A T A A T A A A A A A A A A A A A A A T
2L  8   G   A/T A T A A T A A A A A A A A A A A A A A T
2L  9   G   A/T A T A A T A A A A A A A A A A A A A A T
2L  10  G   A/T A T A A T A A A A A A A A A A A A A A T

Note in the first row (the comment starting with #) we provide the sex for each haploid organism

recombination rate for haploid organisms (!)

Note In order to generate progeny, haploid organism form a transient diploid stage where recombination takes place. Assignment of sex to this transient diploid stage is not possible, thus sex specific recombination rates do not make sense for haploid organism. So which recombination rate to use? MimicrEE2 uses the recombination rate of hermaphrodites for simulations of haploid organisms. We recommend to just provide the default recombination rate (which is valid for all sexes). See the example shown below.

[lambda]
2L:1..10    1

sex info

MimicrEE2 supports simulations with different sexes for haploid organism. Just as for diploids the fractions of males/females/hermaphrodites may be specified in the sex-info file.
If this file is not provided hermaphrodites will be simulated per default.

We store the following into the file sexinfo.txt

M=0.5
F=0.5
H=0.0
MC=1

Note hemizygous sex chromosomes do not make sense for haploid organisms. If a hemizygous sex chromosome is provided for haploid organism, MimicrEE2 will throw an Error!

haploid simulations with sex

We perform neutral forward simulations for 50 generations and store the output haplotypes in the folder output.

mkdir output
java -jar mim2.jar w --haplotypes-g0 basepop.mimhap --snapshots 5,10,20,30,40,50 --output-dir output --haploid --recombination-rate recrate.txt --sex sexinfo.txt

haplotypes at generations

#sex M F F F M F F F F M M F F M F F M F M M
2L  1   G   A/T A A A A A A A A A A A A A A A A A A A A
2L  2   G   A/T A A A A A A A A A A A A A A A A A A A A
2L  3   G   A/T A A A A A A A A A A A A A A A A A A A A
2L  4   G   A/T A A A A A A A A A A A A A A A A A A A A
2L  5   G   A/T A A A A A A A A A A A A A A A A A A A A
2L  6   G   A/T T A T T T T A T A A A A A T A A A T A T
2L  7   G   A/T A A A A A A A A A A A A A A A A A A A A
2L  8   G   A/T A A A A A A A A A A A A A A A A A A A A
2L  9   G   A/T A A A A A A A A A A A A A A A A A A A A
2L  10  G   A/T A A A A A A A A A A A A A A A A A A A A

Related

Wiki: Home
Wiki: SelectedLoci

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.