def decrease_flux(reaction, ref_value, value):
    """
    lb                           0                           ub
    |--------------------------- ' ---------------------------|
                 |- - >----------'
                                 '----------<- - - -|

    Parameters
    ----------
    reaction: cobra.Reaction
        The reaction to down_regulate.
    ref_value: float
        The flux value to come from.
    value: float
        The flux value to achieve.

    """
    if abs(value) > abs(ref_value):
        raise ValueError(
            "'value' is higher than 'ref_value', this is decrease_flux (%f < %f)"
             % (value, ref_value))
    if value > 0:
        reaction.upper_bound = value
    elif value < 0:
        reaction.lower_bound = value
    else:
        reaction.knock_out()
