Closed GoogleCodeExporter closed 9 years ago
Well, I thought I found the bug... and it still may be one.
double RandNumGenerator::expRV(double dLambda){
can (and does) return inf,
macs 10 1 -t 10 -s 3 will generate the behavior
Original comment by augu...@email.arizona.edu
on 3 Oct 2013 at 8:44
Hi August,
Regarding the expRV call returning infinity, in your case above, I think it is
behaving as expected in that because you have a zero recombination rate, the
next position along the chromosome should be infinity. I checked the other
calls in algorithm.cpp to expRV, and I don't think they should be passing a
zero to expRV (e.g. coalescing rate) as there is always an if statement to
check for positivity.
I'm not sure I can address the Python binding issue. I can try but not promise
anything. Can you show me what tweaks you had to make?
Original comment by gche...@gmail.com
on 4 Oct 2013 at 4:40
Well, I think I may have found something that will actually help diagnose this.
In the beginSimulation function: If you change:
GraphBuilder graphBuilder = GraphBuilder(pConfig,rg);
graphBuilder.build();
graphBuilder.printHaplotypes();
TO:
GraphBuilder *graphBuilder = new GraphBuilder(pConfig,rg);
graphBuilder->build();
graphBuilder->printHaplotypes();
delete graphBuilder;
You get differences in the output of macs when you run just 1 simulation. EG:
./macs 100 5000 -T -t 0.001 -s 10 -r 0.0004 -h 1e5 -I 2 50 50 0.5 2> /dev/null
| fgrep TOTAL_SITES
will return 42 in the original code and 44 in the code using 'new'.
I'm not well-enough versed in the code to say whether or not this is expected
behavior, but the code I had had a new'd copy of the GraphBuilder object on
which simulations were being run, so this behavior comes as a bit of a surprise
to me :)
And I can tweak the code such that I don't need the graphbuilder to be saved on
the heap, but I don't know if this is symptomatic of some other type of memory
error or not...?
Thanks for your willingness to help on this issue!
-August
Original comment by augu...@email.arizona.edu
on 22 Oct 2013 at 9:58
I realized that I mispoke (or mistyped). I was keeping the graphbuilder object
b/c I wrote the whole-genome simulations to some arrays stored in this object.
Sorry for the confusion!
-August
Original comment by augu...@email.arizona.edu
on 22 Oct 2013 at 10:25
The memory management behind macs is very complex. It includes a smart pointer
reference counting mechanism thanks to Boost libraries. I don't know if Boost
is to blame but I think digging into this would be monumental to say the least.
Now if you were to run macs over many iterations using the heap or non-heap
version and computed summary statistics over each, would you get different
answers?
Original comment by gche...@gmail.com
on 22 Oct 2013 at 10:50
Original comment by gche...@gmail.com
on 4 May 2014 at 8:57
Original issue reported on code.google.com by
augu...@email.arizona.edu
on 3 Oct 2013 at 8:14