import simuPOP as sim import random import numpy from scipy import stats NOOFITER = 1000 ALPHA = 0.05 #alpha for declaring null hypothesis (no selection) not valid FITN1 = [1,0.8,0.6] #fitness under selection def setSex(pop): for idx,ind in enumerate(pop.individuals()): ind.setSex(sim.MALE if idx % 2 == 0 else sim.FEMALE) return True #start of main subprocedure: def OneRun(noofiter, POPSIZE=50,POPSIZE0=50, FITN = [1,1,1], NOOFFARMPOP=10,NOOFGEN=10,WANTEDSTARTFST=0.042): FST=[] STARTFST=[] for iter in range(0,noofiter): #create population: pop=sim.Population(size=[POPSIZE0]*NOOFFARMPOP,ploidy=2,loci=1,infoFields=['fitness']) #assign sex: sim.initSex(pop, sex=[sim.MALE,sim.FEMALE]) #assign random start freq. in source population: ok=False while not ok: #if ok then start-fst has been successfully generated startfreq=random.random() sim.initGenotype(pop,freq=[startfreq,1-startfreq]) fst=0 k=0 while fst