def calc_bfdp(bf, prior):
    """
    Calculate BFDP for a single gene per Wakefield, AJHG, 2007
    """

    # Wakefield phrases prior as probability of no effect, so we need to invert
    prior = 1 - prior

    po = prior / (1 - prior)
    bftpo = bf * po

    bfdp = bftpo / (1 + bftpo)

    return bfdp