def writeBinData(out_file, i, GenotypeData, ScoreList, NumInfoSites):
num_lines = len(GenotypeData.accessions)
(likeliScore, likeliHoodRatio) = snpmatch.calculate_likelihoods(ScoreList, NumInfoSites)
if len(likeliScore) > 0:
NumAmb = np.where(likeliHoodRatio < snpmatch.lr_thres)[0]
if len(NumAmb) >= 1 and len(NumAmb) < num_lines:
try:
nextLikeli = np.nanmin(likeliHoodRatio[np.where(likeliHoodRatio > snpmatch.lr_thres)[0]])
except:
nextLikeli = 1
for k in NumAmb:
score = float(ScoreList[k])/NumInfoSites[k]
out_file.write("%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % (GenotypeData.accessions[k], int(ScoreList[k]), NumInfoSites[k], score, likeliScore[k], nextLikeli, len(NumAmb), i+1))
评论列表
文章目录