count_tables.py 文件源码

python
阅读 36 收藏 0 点赞 0 评论 0

项目:gamtools 作者: pombo-lab 项目源码 文件源码
def linkage(counts_table):
    """
    Return the linkage disequilibrium (D) for an arbitrary number of
    loci given their contingency table.
    """

    probs_table = frequency_to_probability(counts_table)
    marginal_probs = get_marginal_probabilities(probs_table)

    if either_locus_not_detected(marginal_probs):
        return np.NAN

    exp_freqs = marginal_probs.prod(axis=0)[0]
    observed = probs_table.flat[-1]
    if observed == 0:
        return np.NAN
    return observed - exp_freqs
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号