diff --git a/VERSIONS b/VERSIONS index 98ba8ce4..888853f6 100644 --- a/VERSIONS +++ b/VERSIONS @@ -6,7 +6,8 @@ Note that not every commit will be logged here; that is what the Github commit h development head (in the master branch): - + fixed a bug in calcWattersonsTheta(): the value calculated would be incorrect if a window (start/end) was specified + version 4.2.2 (Eidos version 3.2.2): fix SLiMgui crash with code completion diff --git a/core/slim_functions.cpp b/core/slim_functions.cpp index 486f779e..e340fe68 100644 --- a/core/slim_functions.cpp +++ b/core/slim_functions.cpp @@ -272,6 +272,8 @@ R"V0G0N({ species = community.allSpecies; } + length = species.chromosome.lastPosition + 1; + if (isNULL(muts)) muts = species.mutations; @@ -297,7 +299,7 @@ R"V0G0N({ k = size(muts); n = genomes.size(); a_n = sum(1 / 1:(n-1)); - theta = (k / a_n) / (species.chromosome.lastPosition + 1); + theta = (k / a_n) / length; return theta; })V0G0N";