xx

def getSnpWeightDict():
'''
获取权重字典
算法:F=max(v) F标示某个snp最大出现的频次
for i in I put:w(i)=10-9lnf(i)/ln(F)
:param re:
:param maxcount:
:return:
'''
re=defaultdict(int)
mttree=json.loads(open('./mttreedb.json','r').read())
scanmttreesetsnpcount(mttree,re)
weightdict={}
maxcount=getMaxItem(re)
for k,v in re.items():
weightdict[k]=10-round(9*math.log10(v)/math.log10(maxcount),1)
return weightdict
原文地址:https://www.cnblogs.com/similarface/p/5711884.html