def sensitivity_calc(sign_residues_per_iter):
    """
    | Inputs the output of ``bootstrapped_residue_analysis`` and calculates the sensitivity of each residue.
    | The returned sensitivity of each residue is calculated by calculating ``residue_appearances / iterations``.
    | A sensitivity of 1 is ideal meaning that the residue was significant to all the iterations.
    |

    Args:
        sign_residues_per_iter: A list of sets containing the residue ids of the significant residues on each iteration

    Returns:
        A dictionary of ``ResidueId(key), Sensitivity(value)`` for all the residues that appeared at least on one
        iteration

    """
    sens_dict = {}
    for which_iter in sign_residues_per_iter:
        for which_res in which_iter:
            try:
                sens_dict[which_res] += 1
            except KeyError:
                sens_dict[which_res] = 1

    # Get the sensitivity by calculating residue_appearances / total_iterations
    sens_dict = {k: v / len(sign_residues_per_iter) for k, v in sens_dict.items()}

    return sens_dict