Thursday, March 26, 2009
One last bit of weasling...
So, this weasel thing is actually quite a nice little toy for showing a few truths about how selection works in real populations. The latest complaint from the people that seek to bury evolutionary biology by attacking this toy is that it's not really an example of "cumulative selection" because it's possible for some letters that are already matching the target sequence to revert to a non-matching letter. If a letter can go 'backwards' then how can we say selection on the string is cumulative? Because in most populations most of the time most selection is "purifying"selection, holding on to the advances that have been made in past generations. It's easy enough to use the functions defined in the first post to simulate what would happen if selection stopped half-way through a run:
out_handle = open("weasel.log", 'w') target = "Methinks it is like a weasel" survivor = make_initial(target) generation= 0 while generation < 50: generation = generation + 1 nextgen = make_gen(survivor, target, 100, 0.1, False) fitness, survivor = nextgen out_handle.write("%i\n" % fitness) while fitness != 0: generation = generation + 1 nextgen = make_gen(survivor, target, 100, 0.1, False) #now, relax selection but choosing survivor at random i = Random().sample(range(len(nextgen)), 1) fitness, survivor = nextgen[i] out_handle.write("%i\n" % fitness) print generation, fitness
Removing selection pressure rapidly destroys strings
By choosing a random string in each generation after the 100th we soon loose all the ground we made. We also now that selection is a strong force in large populations and a relatively weak one in small populations.(The large difference in the variance in the n=1000 and n=100 treatments in yesterday's post is a result of this) So lowering the population size to 10 after 100 generations should weaken (but not destroy) the power of purifying selection:
Lowering population size weakens the power of selection
Which is what we see, even in this situation where selection is very weak and strings can actually loose ground in their road to the target string each new generation retains the effects of past generations positive selection (to get the fitness high int he first place) and purifying selection (to retain much more of that fitness in the face of mutation that we could expect by chance). So, each new generation starts with benefits of previous rounds of selection, selection is cumulative.