delt0r / msms

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

Smark occasionally wrong #23

Open ChristianHuber opened 11 years ago

ChristianHuber commented 11 years ago

Occasionally, Smark indicates that the beneficial allele is not present in the sample (only zeros) when oTrace actually shows that the allele has fixed in the population.

F.e. msms -ms 80 1 -t 0 -seed 1234 -r 280 1000 -N 7000 -SFC -SI 0.0735 1 0.01 -Sc 0 1 150 75 0 -Sp 0.5 -oTrace

The last entry of the trace output is 0.01275 7.142857e-05 0.9999286, indicating that the beneficial allele has fixed at time 0.01275.

However, msms -ms 80 1 -t 0 -seed 1234 -r 280 1000 -N 7000 -SFC -SI 0.0735 1 0.01 -Sc 0 1 150 75 0 -Sp 0.5 -Smark results in a column of zeros at pos 0.5, suggesting that the beneficial allele is not present in the sample.

Occasionally it works though, f.e. with seed 1111.

I'm using version 3.2rc Build:131.

delt0r commented 11 years ago

So this is going to all be fixed the reactor which is now a totally full time deal. I don't have a timeline just yet

kimberlymcm commented 9 years ago

Has this bug been fixed? I am running into a similar problem.

msms -ms 400 1 -N 10000 -t 2.4 -r 4.66 -SAA 10 -SAa 5 -Sp 0.5 -SF 0.033 1 -Smark -oTrace

If I understand correctly, the command above should have an allele at position 0.5 fix 0.033 ago. This is what the trace shows (well it is at 0.999 freq 0.033). However, in the output position 0.5 is often all 0s.

If it has not been fixed, is it safe to assume that the selected allele actually is fixed and the -Smark output is incorrect? Or is there something more intrinsically wrong with the simulation results?

Thanks for your help!

stsmall commented 7 years ago

I am also running into this issue. When I use -Smark and something like -Sp 0.5 there is the occasional case where the selected allele and a site in the haplotype strings will have the same coordinates, here 0.5. Adding more precision such as -Sp 0.55555 helps a bit, but it is still a margin case where they are the same coordinate. When I tried to set -Sp 1.1111, so it is outside of the 0-1 interval, it is always a column of 0s regardless of the number of origins.