delt0r / msms

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

Problems with selection before a population split (forward in time) #8

Closed ChristianHuber closed 11 years ago

ChristianHuber commented 11 years ago

I want to introduce a selected mutation in population 1 at time 0.2 and the population should then split into population 1 and 2 at time 0.1. However, it does not seem to work (3.2rc Build:79).

COMMAND:

msms -ms 10 1 -t 4 -I 2 5 5 0 -ej 0.1 2 1 -N 1000 -SFC -SI 0.2 2 0.001 0 -Sc 0 1 500

OUTPUT:

ms 10 1 -t 4 -I 2 5 5 0 -ej 0.1 2 1 -N 1000 -SFC -SI 0.2 2 0.001 0 -Sc 0 1 500 [3.2rc Build:79] 0xc244789794f39f82

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException at java.lang.System.arraycopy(Native Method) at at.mabs.model.selection.SuperFrequencyTrace.getFrequencys(SuperFrequencyTrace.java:142) at at.mabs.model.selection.SelectionData.getFrequency(SelectionData.java:268) at at.mabs.model.selection.SelectionData.coalescentCumulantIntegration(SelectionData.java:296) at at.mabs.coalescent.CoalescentEventCalculator.nextCoalescentSelection(CoalescentEventCalculator.java:361) at at.mabs.coalescent.CoalescentEventCalculator.nextEventSelection(CoalescentEventCalculator.java:90) at at.mabs.coalescent.CoalescentEventCalculator.calculateCoalescentHistory(CoalescentEventCalculator.java:520) at at.MSLike.run(MSLike.java:301) at at.MSLike.runThreads(MSLike.java:424) at at.MSLike.runMe(MSLike.java:191) at at.MSLike.main(MSLike.java:541) at at.MSLike.main(MSLike.java:585)

delt0r commented 11 years ago

So i have finally started to do more than just make this bug move from section of code to section of code. The bug is NOT fixed but we have a workaround.

The problem is the -Sc option at time zero. Setting the time to one generation (1/4N or 1/4000 in this case) does fix the problem and the simulation results will still be accurate.

ChristianHuber commented 11 years ago

There is no error now, but only without the -oTrace option. I still can't check the trace of the forward simulation: msms -ms 10 1 -t 4 -I 2 5 5 0 -ej 0.1 2 1 -N 1000 -SFC -SI 0.2 2 0.001 0 -Sc 0.00025 1 500 -oTrace Does not work. This is the error I get (I already increased the available memory to 1G):

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Arrays.java:2894) at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:117) at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:589) at java.lang.StringBuilder.append(StringBuilder.java:220) at at.mabs.stats.ForwardStatsCollector.paste(ForwardStatsCollector.java:33) at at.mabs.stats.ForwardStatsCollector.collectStats(ForwardStatsCollector.java:24) at at.MSLike.run(MSLike.java:335) at at.MSLike.runThreads(MSLike.java:424) at at.MSLike.runMe(MSLike.java:191) at at.MSLike.main(MSLike.java:541) at at.MSLike.main(MSLike.java:585)

delt0r commented 11 years ago

God dam it.

Working on it.

On Wed, May 8, 2013 at 2:00 PM, Christian Huber notifications@github.comwrote:

There is no error now, but only without the -oTrace option. I still can't check the trace of the forward simulation: msms -ms 10 1 -t 4 -I 2 5 5 0 -ej 0.1 2 1 -N 1000 -SFC -SI 0.2 2 0.001 0 -Sc 0.00025 1 500 -oTrace Does not work. This is the error I get (I already increased the available memory to 1G):

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Arrays.java:2894) at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:117) at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:589) at java.lang.StringBuilder.append(StringBuilder.java:220) at at.mabs.stats.ForwardStatsCollector.paste(ForwardStatsCollector.java:33) at at.mabs.stats.ForwardStatsCollector.collectStats(ForwardStatsCollector.java:24) at at.MSLike.run(MSLike.java:335)

at at.MSLike.runThreads(MSLike.java:424) at at.MSLike.runMe(MSLike.java:191) at at.MSLike.main(MSLike.java:541) at at.MSLike.main(MSLike.java:585)

— Reply to this email directly or view it on GitHubhttps://github.com/delt0r/msms/issues/8#issuecomment-17601084 .

I have no special talents. I am only passionately curious. --Albert Einstein