In [27]:
import populations

In [28]:
reload(populations)


Out[28]:
<module 'populations' from 'populations.py'>

In [29]:
from populations import Population

In [34]:
p1 = Population.create_parental(10, 0)

In [35]:
p2 = Population.create_parental(10, 1)

In [36]:
p1


Out[36]:
array([[0, 0],
       [0, 0],
       [0, 0],
       [0, 0],
       [0, 0],
       [0, 0],
       [0, 0],
       [0, 0],
       [0, 0],
       [0, 0]])

In [37]:
p1.get_allele_frequencies()


Out[37]:
array([ 1.])

In [38]:
p2.get_allele_frequencies()


Out[38]:
array([ 1.])

In [40]:
f1 = p1.cross(p2)

In [41]:
f2 = f1.cross(f1)

In [43]:
f2.get_allele_frequencies()


Out[43]:
array([ 0.5,  0.5])

In [44]:
f2.get_expected_genotype_frequencies()


Out[44]:
array([ 0.25,  0.5 ,  0.25])

In [45]:
f2.get_observed_genotype_frequencies()


Out[45]:
array([ 0.2,  0.6,  0.2])

In [ ]: