Skip to content

Commit

Permalink
bug fix for windowed calcWattersonsTheta()
Browse files Browse the repository at this point in the history
  • Loading branch information
bhaller committed Jul 15, 2024
1 parent 8bc26b9 commit f676217
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion VERSIONS
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion core/slim_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ R"V0G0N({
species = community.allSpecies;
}
length = species.chromosome.lastPosition + 1;
if (isNULL(muts))
muts = species.mutations;
Expand All @@ -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";

Expand Down

0 comments on commit f676217

Please sign in to comment.