pyProWAS.py 文件源码

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

项目:pyPheWAS 作者: BennettLandman 项目源码 文件源码
def get_fdr_thresh(p_values, power):
    """
    Calculate the false discovery rate threshold.

    :param p_values: a list of p-values obtained by executing the regression
    :param power: the thershold power being used (usually 0.05)
    :type p_values: numpy array
    :type power: float

    :returns: the false discovery rate
    :rtype: float
    """
    sn = np.sort(p_values)
    sn = sn[np.isfinite(sn)]
    sn = sn[::-1]
    for i in range(len(sn)):
        thresh = 0.05 * i / len(sn)
        if sn[i] <= power:
            break
    return sn[i]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号