def _lladser_ci_from_r(r, t, alpha=0.95, f=10, ci_type='ULCL'):
    """Construct r-color confidence interval for uncovered conditional prob.

    Returns
    -------
    tuple
        Confidence interval that contains the true conditional uncovered
        probability with a probability of 100% * `alpha`.

    Raises
    ------
    ValueError
        For combinations of `r`, `f`, and `alpha` that do not have precomputed
        results.

    """
    alpha = round(alpha, 2)

    if ci_type == 'U':
        if alpha != 0.95:
            raise ValueError("alpha must be 0.95 if ci_type is 'U'.")
        if r not in _UPPER_CONFIDENCE_BOUND:
            raise ValueError("r must be between 1-25 or 50 if ci_type is 'U'.")
        return 0.0, _UPPER_CONFIDENCE_BOUND[r] / t
    elif ci_type == 'L':
        if alpha != 0.95:
            raise ValueError("alpha must be 0.95 if ci_type is 'L'.")
        if r not in _LOWER_CONFIDENCE_BOUND:
            raise ValueError("r must be between 1-25 if ci_type is 'L'.")
        return _LOWER_CONFIDENCE_BOUND[r] / t, 1.0

    bound_params = _ul_confidence_bounds(f, r, alpha)
    if ci_type == 'ULCL':
        bound_param = bound_params[0]
    elif ci_type == 'ULCU':
        bound_param = bound_params[1]
    else:
        raise ValueError("Unknown ci_type '%s'." % ci_type)

    upper_bound = bound_param * f / t
    lower_bound = bound_param / t

    # make sure upper bound is at most 1
    if upper_bound > 1:
        upper_bound = 1.0

    return lower_bound, upper_bound
dataset/ETHPy150Open biocore/scikit-bio/skbio/diversity/alpha/_lladser.py/_lladser_ci_from_r/original