def adjust_indel_rates(expected):
    """ adapt indel rates for lower rate estimate from validated de novos
    
    The indel mutation rates from Samocha et al., Nature Genetics 46:944-950
    assume that the overall indel mutation rate is 1.25-fold greater than the
    overall nonsense mutation rate, ie there are 1.25 times as many frameshifts
    as nonsense mutations. We have our own estimates for the ratio, derived from
    our de novo validation efforts, which we shall apply in place of the Samocha
    et al ratios.
    
    Args:
        rates: data frame of mutation rates.
    
    Returns:
        the rates data frame, with adjusted indel rates.
    """
    
    # the following numbers were derived from the DDD 4K dataset.
    nonsense_n = 411
    frameshift_n = 610
    ddd_ratio = frameshift_n / nonsense_n
    samocha_ratio = 1.25  # Nature Genetics 46:944-950 frameshift to nonsense ratio
    
    # correct back from using the Samocha et al. ratio
    expected["missense_indel"] /= samocha_ratio
    expected["lof_indel"] /= samocha_ratio
    
    # adjust the indel rates for the DDD indel ratio
    expected["missense_indel"] *= ddd_ratio
    expected["lof_indel"] *= ddd_ratio
    
    return expected