gchen98 / macs

Automatically exported from code.google.com/p/macs
16 stars 6 forks source link

potential bug when simulating with migration #20

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I compared the output between macs and ms under a simple demographic scenario 
(see command lines below). The macs command produces many more segregating 
sites than ms under the same parameters. If I switch off migration, the two 
commands give similar results. Here are some simple bash-command lines to check:

First ms:
$ ms 4 10 -I 2 2 2 -ej 0.4 2 1 -eM 0.2 1 -t 1000 -r 400 1000000 | grep segsites
segsites: 2908
segsites: 2848
segsites: 2701
segsites: 2842
segsites: 2882
segsites: 2703
segsites: 2712
segsites: 2635
segsites: 2985
segsites: 2860

Now macs:
$ for i in {1..10}; do macs 4 1000000 -s $RANDOM -t 0.001 -r 0.0004 -I 2 2 2 
-ej 0.4 2 1 -eM 0.2 1 2> /dev/null | grep TOTAL_SITES; done
TOTAL_SITES:    3848
TOTAL_SITES:    4427
TOTAL_SITES:    3942
TOTAL_SITES:    4345
TOTAL_SITES:    4182
TOTAL_SITES:    4016
TOTAL_SITES:    3716
TOTAL_SITES:    3962
TOTAL_SITES:    4120
TOTAL_SITES:    4545

Now macs without migration:
$ for i in {1..10}; do macs 4 1000000 -s $RANDOM -t 0.001 -r 0.0004 -I 2 2 2 
-ej 0.4 2 1 -eM 0.2 0 2> /dev/null | grep TOTAL_SITES; done
TOTAL_SITES:    2734
TOTAL_SITES:    2722
TOTAL_SITES:    2618
TOTAL_SITES:    2855
TOTAL_SITES:    2759
TOTAL_SITES:    2861
TOTAL_SITES:    2930
TOTAL_SITES:    2599
TOTAL_SITES:    2658
TOTAL_SITES:    2638

and ms without migration:
$ ms 4 10 -I 2 2 2 -ej 0.4 2 1 -eM 0.2 0 -t 1000 -r 400 1000000 | grep segsites
segsites: 3028
segsites: 2435
segsites: 2782
segsites: 2673
segsites: 2997
segsites: 2937
segsites: 2232
segsites: 2547
segsites: 2959
segsites: 2798

I am using version 0.5c, the currently newest version of macs.

Original issue reported on code.google.com by stschiff...@googlemail.com on 13 Nov 2013 at 8:21

GoogleCodeExporter commented 9 years ago
That is odd.  I don't seem to be reproducing your increase in sites with the 
migration enabled case. Here is my output:

[garyc@ssb202q-1 macs]$ for i in {1..10}; do macs 4 1000000 -s $RANDOM -t 0.001 
-r 0.0004 -I 2 2 2 -ej 0.4 2 1 -eM 0.2 0 2> /dev/null | grep TOTAL_SITES; done
TOTAL_SITES:    2704
TOTAL_SITES:    2588
TOTAL_SITES:    2900
TOTAL_SITES:    2865
TOTAL_SITES:    2418
TOTAL_SITES:    2721
TOTAL_SITES:    2930
TOTAL_SITES:    2838
TOTAL_SITES:    2944
TOTAL_SITES:    2629
[garyc@ssb202q-1 macs]$ for i in {1..10}; do macs 4 1000000 -s $RANDOM -t 0.001 
-r 0.0004 -I 2 2 2 -ej 0.4 2 1 -eM 0.2 1 2> /dev/null | grep TOTAL_SITES; done
TOTAL_SITES:    2752
TOTAL_SITES:    2666
TOTAL_SITES:    2826
TOTAL_SITES:    2698
TOTAL_SITES:    2647
TOTAL_SITES:    2756
TOTAL_SITES:    2515
TOTAL_SITES:    2696
TOTAL_SITES:    2842
TOTAL_SITES:    2793

Original comment by gche...@gmail.com on 25 Nov 2013 at 10:52

GoogleCodeExporter commented 9 years ago
I'm using the latest SVN update.  Can you try running svn update, make clean, 
make, and seeing if anything changes?

Original comment by gche...@gmail.com on 25 Nov 2013 at 10:53

GoogleCodeExporter commented 9 years ago
OK, that works. I updated to the latest SVN, it works. So it must have been 
fixed between version 0.5c and the latest SVN then, maybe you find the error 
source, maybe you just want to update the latest release :-)

But thanks for your help!

Stephan

Original comment by stschiff...@googlemail.com on 26 Nov 2013 at 9:47

GoogleCodeExporter commented 9 years ago
OK I'll update then.

Original comment by gche...@gmail.com on 26 Nov 2013 at 5:29