#在Python3 下运行
def recombination(strm,strf): #strm 代表母本的配子 p_strm代表strm母本配子的概率
combination=[]
for m in strm:
for f in strf:
hezi = m+f
combination.append(hezi)
return combination
def count_possibility(combination): #计算父本母本交配得到的基因型的频率
sum_number =4
dict_temp={}
for i in combination:
number = combination.count(i)
dict_temp[i]=number/sum_number
return dict_temp
def dict_def(): #新建两个空的字典,分别代表母本和父本的基因型频率
dictm={"AA":0,"Aa":0,"aA":0,"aa":0};
dictf={"AY":0,"aY":0,"YA":0,"Ya":0};
return dictm,dictf
def traverse_dict(dictm,dictf):#dictm 母本所有基因型的字典,key为基因型,value为基因型频率
dictm_new,dictf_new=dict_def()
for m_gene in dictm :
pos_m = dictm[m_gene] #母本的
雌雄异体,伴X染色体的等位基因(2个),计算子代的基因型频率
最新推荐文章于 2024-09-02 23:14:47 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)