gchen98 / macs

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

error with specifying migration rates #29

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Run this command:
macs 18 1000000.0 -t 0.0014 -r 0.0004 -I 12 3 3 0 0 0 3 3 0 0 0 3 3 -m 1 2 40.0 
-m 2 1 40.0 -m 1 7 40.0 -m 7 1 40.0 -m 2 3 40.0 -m 3 2 40.0 -m 2 7 40.0 -m 7 2 
40.0 -m 8 7 40.0 -m 7 8 40.0 -m 2 8 40.0 -m 8 2 \
40.0 -m 5 6 40.0 -m 6 5 40.0 -m 6 11 40.0 -m 11 6 40.0 -m 6 12 40.0 -m 12 6 
40.0 -m 11 10 40.0 -m 10 11 40.0 -m 11 12 40.0 -m 12 11 40.0 -em 0.0125 3 8 
40.0 -em 0.0125 8 3 40.0 -em 0.0125 3 4 40.0 -em 0.0125 4 3 40.0 -em 0.0125 4 5 
40.0 -em 0.0125 5 4 40.0 -em 0.0125 3\
 9 40.0 -em 0.0125 9 3 40.0 -em 0.0125 8 9 40.0 -em 0.0125 9 8 40.0 -em 0.0125 4 10 40.0 -em 0.0125 10 4 40.0 -em 0.0125 9 10 40.0 -em 0.0125 10 9 40.0 -em 0.0125 4 9 40.0 -em 0.0125 9 4 40.0 -em 0.0125 5 10 40.0 -em 0.0125 10 5 40.0

What is the expected output? What do you see instead?
INPUT: Sample size is now 18
INPUT: Seq length is now 1e+06
INPUT: Scaled mutation rate is now 1400
INPUT: Scaled recombination rate is now 400
INPUT: Setting chr sampled for pop 1 to 3
INPUT: Setting chr sampled for pop 2 to 3
INPUT: Setting chr sampled for pop 3 to 0
INPUT: Setting chr sampled for pop 4 to 0
INPUT: Setting chr sampled for pop 5 to 0
INPUT: Setting chr sampled for pop 6 to 3
INPUT: Setting chr sampled for pop 7 to 3
INPUT: Setting chr sampled for pop 8 to 0
INPUT: Setting chr sampled for pop 9 to 0
INPUT: Setting chr sampled for pop 10 to 0
INPUT: Setting chr sampled for pop 11 to 3
INPUT: Setting chr sampled for pop 12 to 3
INPUT: Global migration rate to 0
INPUT: At time 0.0125: Mig rate of source pop 3 to dest pop 8 set to 40.0.
INPUT: At time 0.0125: Error, this event is redundant with a previous time.  
Please increment it slightly from 0.0125 to prevent unpredictable results

What version of the product are you using? On what operating system?
Most current version. linux

Please provide any additional information below.
command worked with ms

Original issue reported on code.google.com by halasad...@gmail.com on 2 Feb 2015 at 9:54

GoogleCodeExporter commented 9 years ago
Hi there,

This isn't a bug and is indeed a subtle difference in parameter convention from 
ms. It's valid to implement the suggestion in the debug messages.  ms is 
sensitive to the strict ordering of the event parameters in traversing the 
event list. macs is sensitive only to the event times, so you can put two 
migration events for example where your intent is -em 0.0125 10 4 40 -em 0.0125 
9 10 40 to -em 0.01250000001 10 4 40 -em 0.01250000002 9 10 40, and this will 
still provide correct output. If the two event times are strictly equal, then 
we noticed inconsistencies can occur and cause bugs in the output.

Original comment by gche...@gmail.com on 3 Feb 2015 at 4:47

GoogleCodeExporter commented 9 years ago
Is it possible to go around this problem by using the -ema command to specify 
the migration rates in one go?

Original comment by halasad...@gmail.com on 3 Feb 2015 at 4:56

GoogleCodeExporter commented 9 years ago
Yes that is a valid workaround.

Original comment by gche...@gmail.com on 3 Feb 2015 at 3:19

GoogleCodeExporter commented 9 years ago
Thank you for you quick responses. I used the -ema command but I ran into 
another problem:
INPUT: Sample size is now 18
INPUT: Seq length is now 1e+07
INPUT: Scaled mutation rate is now 14000
INPUT: Scaled recombination rate is now 4000
INPUT: Setting chr sampled for pop 1 to 3
INPUT: Setting chr sampled for pop 2 to 3
INPUT: Setting chr sampled for pop 3 to 0
INPUT: Setting chr sampled for pop 4 to 0
INPUT: Setting chr sampled for pop 5 to 0
INPUT: Setting chr sampled for pop 6 to 3
INPUT: Setting chr sampled for pop 7 to 3
INPUT: Setting chr sampled for pop 8 to 0
INPUT: Setting chr sampled for pop 9 to 0
INPUT: Setting chr sampled for pop 10 to 0
INPUT: Setting chr sampled for pop 11 to 3
INPUT: Setting chr sampled for pop 12 to 3
INPUT: Global migration rate to 0
INPUT: At time 0.0125: Full migration matrix provided by the user
Debugging: 0

Graph Builder begin
terminate called after throwing an instance of 'std::bad_alloc'
  what():  St9bad_alloc

The command is: 
macs 18 10000000.0 -t 0.0014 -r 0.0004 -I 12 3 3 0 0 0 3 3 0 0 0 3 3 -m 1 2 
40.0 -m 2 1 40.0 -m 1 7 40.0 -m 7 1 40.0 -m 2 3 40.0 -m 3 2 40.0 -m 2 7 40.0 -m 
7 2 40.0 -m 8 7 40.0 -m 7 8 40.0 -m 2 8 40.0 -m 8 2 40.0 -m 5 6 40.0 -m 6 5 
40.0 -m 6 11 40.0 -m 11 6 40.0 -m 6 12 40.0 -m 12 6 40.0 -m 11 10 40.0 -m 10 11 
40.0 -m 11 12 40.0 -m 12 11 40.0 -ema 0.0125 12 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 40.0 0.0 0.0 0.0 40.0 40.0 0.0 
0.0 0.0 0.0 0.0 40.0 0.0 40.0 0.0 0.0 0.0 40.0 40.0 0.0 0.0 0.0 0.0 0.0 40.0 
0.0 0.0 0.0 0.0 0.0 40.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 40.0 0.0 0.0 0.0 
0.0 0.0 40.0 0.0 0.0 0.0 0.0 0.0 40.0 40.0 0.0 0.0 0.0 40.0 0.0 40.0 0.0 0.0 
0.0 0.0 0.0 40.0 40.0 0.0 0.0 0.0 40.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 
0.0 0.0 0.0 0.0

Original comment by halasad...@gmail.com on 3 Feb 2015 at 6:03