In [1]:
import sys
sys.path.append('../src')
from popgen import *
%matplotlib inline
from ipywidgets import interact

Simple example - Biallelic


In [12]:
def drift_pop(num_msats, pop_size):
    m = SinglePop(gens=100)
    m.num_msats = num_msats
    m.pop_size = pop_size
    BasicView(m, [ExpHe()], ['mean'], min_y=[0], max_y=[1])
    m.run()
    
interact(drift_pop, num_msats=(2, 20, 1), pop_size=(30, 530, 50))



In [3]:
m = SinglePop(gens=100)
m.num_snps = 11
m.pop_size = 50
BasicView(m, [ExpHe()], ['mean'])
m.run()



In [4]:
m = SinglePop(gens=100)
m.num_snps = 5
m.snp_freq = [0.01, 0.05, 0.1, 0.5, 0.9]
m.pop_size = 50
BasicView(m, [ExpHe()], ['mean'])
m.run()


Simple example - Microsatellites


In [5]:
m = SinglePop(gens=100)
m.num_msats = 10
m.pop_size = 50
BasicView(m, [ExpHe(), NumAlleles()], ['mean'])
m.run()



In [6]:
m = SinglePop(gens=100)
m.num_msats = 10
m.pop_size = 50
m.num_msats = [2, 5, 10, 20]
BasicView(m, [ExpHe(), NumAlleles()], ['mean'])
m.run()


Compare size


In [7]:
m = SinglePop(gens=100)
m.num_msats = 10
m.pop_size = [50, 100, 200, 500, 1000]
BasicView(m, [ExpHe(), NumAlleles()], ['mean'])
m.run()


Compare drift


In [8]:
m = SinglePop(gens=200)
m.num_msats = 10
m.pop_size = [50, 50, 1000, 1000]
BasicView(m, [ExpHe(), NumAlleles()], ['mean'])
m.run()


Sample size


In [9]:
m = SinglePop(gens=50)
m.num_msats = 10
m.pop_size = 500
m.sample_size = [5, 10, 50, 100, 500]
BasicView(m, [ExpHe(), NumAlleles()], ['mean'])
m.run()



In [ ]: