delt0r / msms

A coalsecent simulator with selection
www.mabs.at/ewing/msms
17 stars 7 forks source link

Questions on -SI, -Sc with -oOC #36

Open szpiech opened 10 years ago

szpiech commented 10 years ago

My ultimate goal is to simulate local adaptation from standing variation. I have been testing the following command (adapted from an example in the manual, pg 17, section 7.1)

./msms -N 10000 -ms 10 1 -I 4 0 0 10 0 0 -t 10 -r 10 1000 -es 0 3 .5 -ej 0 4 5 -g 2 10 -g 3 100 -g 5 200 -n 2 .0 -n 3 2 -n 5 11 -m 1 3 5 -m 3 1 5 -m 1 2 2 -m 2 1 2 -ej 0.04 5 3 -ej 0.05 3 2 -en 0.05 2 .5 -em 0.05 1 2 12 -em 0.05 2 1 12 -ej 0.15 2 1 -en 0.2 1 .5 -SI 0.05 5 0 0 0.01 0 0 -Sc 0 3 200 100 0 -Smark -Sp 0.5 -oTrace -oOC

which is intended to simulate multiple populations with selection on standing variation (frequency = 0.01) in pop 3 starting at 0.05 coalescent units ago. I get something like the following (I have sliced out the most of the trajectory trace).

ms -N 10000 10 1 -I 4 0 0 10 0 0 -t 10 -r 10 1000 -es 0 3 .5 -ej 0 4 5 -g 2 10 -g 3 100 -g 5 200 -n 2 .0 -n 3 2 -n 5 11 -m 1 3 5 -m 3 1 5 -m 1 2 2 -m 2 1 2 -ej 0.04 5 3 -ej 0.05 3 2 -en 0.05 2 .5 -em 0.05 1 2 12 -em 0.05 2 1 12 -ej 0.15 2 1 -en 0.2 1 .5 -SI 0.05 5 0 0 0.01 0 0 -Sc 0 3 200 100 0 -Smark -Sp 0.5 -oTrace -oOC  [3.2rc Build:164]
0xd20ebc719d2f106f

//
Frequency Trace:

0.05    1.0 0.0 1.0 0.0 0.99    0.01    1.0 0.0 1.0 0.0 
...
2.5E-5  0.92165 0.07835 1.0 0.0 0.03795000000000004 0.96205 1.0 0.0 0.9048590909090909  0.0951409090909091  
segsites: 15
positions: 0.0976025195 0.1573700168 0.2480442790 0.2947187082 0.3340018485 0.3489600273 0.4304386562 0.4331118262 0.4694306595 0.5000000000 0.5945463987 0.5972476810 0.7035661571 0.7059918338 0.8471029822 
100100001010100
010010100000010
100101000201000
011000100300010
011000100300010
100100001010101
100000011100000
100101000201000
100101000201000
100101000201000

OriginCount:3

I have not explicitly set -Smu, so I expect it to be 0. However, can you explain the origin count of 3 in this context? My suspicion is that the derived allele was segregating (at 0.01 frequency) on three different haplotypes when selection turned on at time 0.05. Is this correct? At the -Smark locus, when OriginCount is > 1, I notice alleles coded with numbers > 1. Do these effectively represent the haplotype background on which the allele was segregating at the time selection turned on?

Finally, in the context of -SI 0.05 5 0 0 0.01 0 0, presumably the allele segregating at 0.01 in population three neutrally drifts to loss backwards in time from 0.05?

Thanks!